Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🌏 This is the Internationalization project for Solidus

License

NotificationsYou must be signed in to change notification settings

solidusio/solidus_i18n

CircleCIGem Version

This is the Internationalization project forSolidus


Changes in Version 2.0

solidus_i18n Version 2.0+ only contains translation files.

Previous versions of solidus_i18n included extra functionality like localeselectors and which is now built in to Solidus 2.6+. Configuration forrouting-filter has also been removed and must be configured manually(SeeLocale in URL).

Installation

Add the following to yourGemfile:

gem'solidus_i18n'gem'rails-i18n'gem'kaminari-i18n'

Locale in URL

Older versions of solidus_i18n included the routing-filter gem and configured routes to include the locale in the URL.This is still supported (maybe even recommended) but requires some additional configuration.

  1. Add this gem to yourGemfile, then runbundle install
gem'routing-filter'
  1. Addfilter :locale to yourconfig/routes.rb
Rails.application.routes.drawdofilter:localemountSpree::Core::Engine,at:'/'end
  1. Configure routing-fitler inconfig/initializers/locale_filter.rb (optional)
# Do not include the default locale in the URLRoutingFilter::Locale.include_default_locale=false

Supported languages

We currently support thefollowing localesby default. If you need a locale that is not in the list you can add a customtranslation file into your application by following theRails translations guide.

Updating Translations

If you want to improve the translations on your language, run the tasks:

bundle exec rake solidus_i18n:update_defaultbundle exec i18n-tasks add-missing --nil-value --locale <LOCALE>

Substitute with your locale code (e.g:it).

This will do a cleanup and prepare<LOCALE>.yml with all the missing keys.You can then write the translations and open a pull request.

Model Translations

Weremoved support for translating models intoa separate Gem.

Please update yourGemfile if you still need the model translations.

# Gemfilegem'solidus_globalize',github:'solidusio-contrib/solidus_globalize',branch:'master'

Localizing country names

You can translate country names by definingspree.country_names in your own locale files. For example, to have countries in Spanish do:

es:spree:country_names:US:Estados Unidos de AméricaUK:Reino UnidoCA:Canadá# ...

Some supported languages already define localized country names. Take a look at this repo's.yml files for your locale to confirm if we already provide translations.

Contributing

Solidus is an open source project and we encourage contributions. Please readCONTRIBUTING.md before contributing.


[8]ページ先頭

©2009-2025 Movatter.jp