The project is in a healthy, maintained state
Spree Commerce Address format i18n Extension
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

SpreeAddressFormatI18n

This extension provides:

  1. Customizable address field ordering through YAML configuration
  2. Japanese kana field support for addresses (firstname_kana, lastname_kana)

Install

Add the following line to your application's Gemfile:

gem "spree_address_format_i18n", :git => "https://github.com/be-agile/spree_address_format_i18n.git", :branch => 'master'

Run:

bundle install
bundle exec rails g spree_address_format_i18n:install

Configuration

To customize the order of address fields, create a YAML file in your application's config/locales directory:

# config/locales/order.ja.yml
ja:
  address_format_i18n:
    - lastname
    - firstname
    - lastname_kana
    - firstname_kana
    - country
    - zipcode
    - state
    - city
    - address1
    - address2

The extension will use this configuration to determine the order of fields in address forms and displays. Fields not specified in the configuration will be displayed at the end in their default order.

Japanese Kana Support

This extension adds support for Japanese kana fields (firstname_kana, lastname_kana) to Spree addresses. These fields are automatically added to the database when you run the migrations.

To use the kana fields:

  1. Make sure you've run the migrations: bundle exec rails g spree_address_format_i18n:install
  2. Include the kana fields in your address_format_i18n configuration (see example above)
  3. The kana fields will be displayed in address forms and on address display pages according to your configuration

Validation for kana fields ensures that they contain only katakana characters.