Coder Social home page Coder Social logo

spree-contrib / spree_i18n Goto Github PK

View Code? Open in Web Editor NEW
347.0 38.0 765.0 9.2 MB

I18n translation files for Spree Commerce.

Home Page: http://guides.spreecommerce.org

License: BSD 3-Clause "New" or "Revised" License

Ruby 100.00%
spree-commerce spree ecommerce i18n rails internationalization translation

spree_i18n's Introduction

Spree Internationalization

Build Status Code Climate

This is the Internationalization project for Spree Commerce See the official Internationalization documentation for more details.

Happy translating!

Maintained by

Vendo

All-in-one platform for all your Marketplace and B2B eCommerce needs. Start your 30-day free trial

Installation

  1. Add this extension to your Gemfile with this line:
gem 'spree_i18n'
  1. Install the gem using Bundler:
bundle install
  1. Copy & run migrations
bundle exec rails g spree_i18n:install
  1. Restart your server

If your server was running, restart it so that it can find the assets properly.

Upgrading to 5.0 (only Spree 4.2+)

1. Remove Asset references

From vendor/assets/javascripts/spree/backend/all.js

//= require spree/backend/spree_i18n

and from vendor/assets/javascripts/spree/frontend/all.js

//= require spree/frontend/spree_i18n

and from vendor/assets/stylesheets/spree/backend/all.css

*= require spree/backend/spree_i18n

and from vendor/assets/stylesheets/spree/frontend/all.css

*= require spree/backend/spree_i18n

Contributing

See corresponding guidelines


Copyright (c) 2010-2015 Spree Commerce Inc. and other contributors. released under the New BSD License

spree_i18n's People

Contributors

adhlssu07 avatar agnieszkajacek avatar alepore avatar aneskap avatar camelmasa avatar cbilgili avatar daan- avatar damianlegawiec avatar futhr avatar geekoncoffee avatar greendog avatar hnatt avatar huoxito avatar jdutil avatar jpavello avatar kagetsuki avatar matthewkennedy avatar maxim-filimonov avatar peterberkenbosch avatar pszyszkaspark avatar pusewicz avatar radar avatar rafalcymerys avatar reinaris avatar romul avatar sadfuzzy avatar schof avatar tka avatar tobiashm avatar tvdeyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_i18n's Issues

Syntax for combined keys does not work

Hi,

i see "translation missing" messages in the spree admin backend. I figured out, that the ruby I18n gem cannot not really handle combined keys like:

spree/order:
date_picker:
format: 'yy/mm/dd'

So it says in german mode it is missing the translation: de.spree.date_picker.format

Line 1078 of de.yml (and en-BG.yml) contains the key spree/order: which contains then date_picker and format. But this key is never used for any translation. In English it falls back to the translation from spree_core en.yml line 996 spree.date_picker.format

This key contains '%Y/%m/%d' placeholders used by strftime to format the date. The translation in spree_i18n is holding a wrong translation: 'yy/mm/dd' which leads to date format problems in other languages except english.

So my suggestion is to change the master language to contain separate keys for spree and order even though it means there are not "DRY" anymore.

And then please correct the master languages translation for spree.date_picker.format. This could lead in correct translation for other languages.

Thx a lot

Chris

et.yml parsing error

After installing spree_i18n, I get this error:

Psych::SyntaxError
couldn't parse YAML at line 998 column 30

The et.yml file seems to be the cause. Deleting it from from the gem solves the problem.

Change to locales from spree_i18n causes NoMethodError in Spree/admin/overview#index

I installed a stock spree app with all the sample and seed data. When I install spree_i1n and chang the locale to de, the frontend renders just fine with locale changed but the admin interface shows this error:

NoMethodError in Spree/admin/overview#index

Showing /home/lamnk/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/admin/shared/_translations.html.erb where line #16 raised:

undefined method `reject' for "translation missing: de.date.month_names":String

Trace of template inclusion: /home/lamnk/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/admin/shared/_head.html.erb, /home/lamnk/.rvm/gems/ruby-2.0.0-p0/gems/spree_core-1.3.2/app/views/spree/layouts/admin.html.erb

spree_i18n tasks not added to project tasks

Hi,
I added the spree_i18n gem into my spree application according to the readme
I can see 40 available locales but I can't see any of the rake tasks that were supposed to be added.
Am I missing something?

Why are languages auto-updated with English?

Assume translation files for the three languages en, de, and de-ch. en is obviously the master and so when new strings are being added there, an auto-update rake task seems to be adding the missing keys to de and de-ch.

If this is really the case then I think this is plain wrong. They should only be added in a commented out form, to make actual translation easier.

Missing translations should be handled through fallbacks (I18n::Backend::Fallbacks). The problem I'm experiencing right now is that while de is relatively well maintained and there are German strings, country-specific variantes (like de-ch) aren't. Instead of simply leaving untranslated stuff commented out so that there would be a fallback to the (usually translated) base German, the country-specific file contains the default English strings.

See for instance https://github.com/spree/spree_i18n/blob/master/config/locales/de-CH.yml#L52 and https://github.com/spree/spree_i18n/blob/master/config/locales/de.yml#L52

undefined method `read_file' for main:Object

When I run

rake spree_i18n:stats

I get this error:

undefined method `read_file' for main:Object

I think it was introduced in this commit ecf24ca
I figured it should be

Spree::I18nUtils.read_file

instead of

read_file

But adding that created a different error

undefined method `/' for nil:NilClass

Didn't have time to investigate further.

no such file to load -- ./lib/spree/i18n_utils

ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

rake -T
(in /home/user/code/project)
rake aborted!
no such file to load -- ./lib/spree/i18n_utils
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in     `require'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in     `block in require'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in     `block in load_dependency'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in     `new_constants_in'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in     `load_dependency'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:239:in     `require'
/home/user/.bundler/ruby/1.9.1/spree_i18n-d20bc189a2dd/lib/tasks/i18n.rake:1:in `<top     (required)>'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in     `load'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in     `block in load'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in     `block in load_dependency'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:591:in     `new_constants_in'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:225:in     `load_dependency'
/usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.1/lib/active_support/dependencies.rb:235:in     `load'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:131:in `block in load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:131:in `each'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/engine.rb:131:in `load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:140:in `block in     load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application/railties.rb:11:in `each'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application/railties.rb:11:in `all'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:140:in `load_tasks'
/usr/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing'
/home/user/code/project/Rakefile:7:in `<top (required)>'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/bin/rake:31:in `<main>'

rake spree:i18n:sync --trace

I am trying to get the i18n running for my spree 0.11.2 project and run in in heroku, but the
rake spree:i18n:sync --trace
command yields this:

** Invoke spree:i18n:sync (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
syntax error on line 27, col 6: })' /usr/lib/ruby/1.8/yaml.rb:133:inload'
/usr/lib/ruby/1.8/yaml.rb:133:in load' /usr/lib/ruby/1.8/yaml.rb:144:inload_file'
/usr/lib/ruby/1.8/yaml.rb:143:in open' /usr/lib/ruby/1.8/yaml.rb:143:inload_file'
/home/peter/Desktop/spree0.11.0/zilpzalp/config/initializers/locales.rb:14
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/enumerable.rb:80:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/enume

how can I change the locals.rb that it works again?

rake spree_i18n:update_default aborted.

rake spree_i18n:update_default

~/Job/spree_i18n[master]% bundle exec rake spree_i18n:update_default
Thor has already been required. This may cause Bundler to malfunction in unexpected ways.
rake aborted!
Don't know how to build task 'spree_i18n:update_default'

(See full trace by running task with --trace)

rake -T

~/Job/spree_i18n[master]% rake -T
Thor has already been required. This may cause Bundler to malfunction in unexpected ways.
rake build                        # Build spree_i18n-1.0.0.gem into the pkg directory
rake common:test_app[user_class]  # Generates a dummy app for testing
rake install                      # Build and install spree_i18n-1.0.0.gem into system gems
rake release                      # Create tag v1.0.0 and build and push spree_i18n-1.0.0.gem to Rubygems
rake spec                         # Run RSpec code examples
rake test_app                     # Generates a dummy app for testing

missing relation error in spree 2-0-stable

Hi,

after upgrading to 2-0-stable (both spree & spree_i18n branches) and doing db:migrate, I'm getting the following error about missing relation:

PG::Error: ERROR: relation "spree_taxon_translations" does not exist
LINE 5: WHERE a.attrelid = '"spree_taxon_translations"'...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"spree_taxon_translations"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

Can anybody else confirm 2-0-branch is not working ?

Texts with %{not} is not translatable into Japanese

Spree's locale file includes some texts that has %{not} inside, like as:

  allowed_ssl_in_production_mode: "SSL will %{not} be used in production"
  backordering_is_allowed: "Backordering %{not} allowed"
  products_with_zero_inventory_display: "Products with a zero inventory will %{not} be displayed"

These texts are not translatable into Japanese because its syntax is completely different from European languages.

Please provide us both of affirmative and negative sentence.

I'm not sure if this is the appropriate place to post this issue. Should I post it to spree/spree?

Missing Japanese translations

Hi,

I think the following texts in the checkout process are missing Japanese translations:
credit card
coupon code
This field is required. (form validation error message)

Please let me know if I'm at the right place and this is descriptive enough.

Thanks!

rake's tasks is wrong action

When execute this action
(spree_i18n:update_default,
spree_i18n:new)
it writes locale file in gem directory/config/locales.
dit not write rails's root/config/locales.
i can't know reason.

Make it possible to add cutomized i18n sample data

When we run rake spree_sample:load, It will load EUR and USD currency products which is defined in spree_sample/db/samples/products.rb . It's inconvenient for developer who doesn't use these two currency since the store will be empty if you use different default locale. I always have to update spree_prices currency column to my locale manually. It would be better if we can override default sample data to fit our locale and translation.

override SpreeSample module like this: SpreeSample Override

then you can put your override in lib/db/samples and named as #{sample}.rb or #{sample}.#{locale}.rb. For example, if you want to override products sample and add zh-TW price:
products.zh-TW.rb

missing property @pt-BR

Updating or creating a new product will raise a RegexpError in spree_core (1.2.0) app/models/spree/variant.rb:142:in `parse_price'. Details: (empty range in char class: /[^0-9-translation missing: pt-BR.number.currency.format.separator]/)
To avoid the error add the following properties to pt-BR.yml locale:
pt-BR:
number:
currency:
format:
separator: "."
delimiter: ","

Just a comment. Feel free to update the sources. pt-BR translate is outdated by the way. Thanks for the time and keep the good work.

Vietnamese must be renamed to 'vi'

The Vietnamese translation is currently named 'vn', this should be renamed to 'vi' to conform with rails-i18n. If we use 'vn' then we'd get missing translation in admin b/c rails-i18n doesn't have a translation for 'vn'

de.spree.X is now de.X

Hey everyone,

I'm currently migrating my Spree Shop to the Spree 2. I'm using this excellent i18n project to translate the entire shop to German. Since the update, I get a bunch of translation missings. They all have the same problem: They search for a key like de.spree.X, but in this project it is de.X. Examples for that include: de.spree.products, de.spree.home, de.spree.price_range and many, many more.

Is this a configuration problem at my part? Or a version conflict?

The part of my Gemfile with spree gems looks like this:

# Spree Gems
gem 'spree',
  :git => 'https://github.com/spree/spree',
  :branch => '2-0-stable'

gem 'spree_auth_devise',
  :git => 'https://github.com/spree/spree_auth_devise',
  :branch => '2-0-stable'

gem 'spree_i18n',
  :git => 'https://github.com/spree/spree_i18n.git',
  :branch => '2-0-stable'

gem 'spree_static_content',
  :git => 'https://github.com/spree/spree_static_content.git',
  :branch => '2-0-stable'

I'm using Rails 3.2.13.

Can't load translations

When I try to start the server, the de locale is failing.

can not load translations from /Users/victor/.rvm/gems/ruby-1.9.3-p194@lavinia/bundler/gems/spree_i18n-77d44452b302/lib/spree_i18n/../../config/locales/de.yml, expected it to return a hash, but does not (I18n::InvalidLocaleData)

It's happening with the gem at the latest commit (77d4445)

nl loacle not synced with localeapp

I got the nl translation up to 100% a while back on localeapp, however I see it's not yet been synced with this repo. Can someone take care of that please? or can I do this myself ?

Main problem is that on 2-0-stable the translations are not namespaced yet even-though the Spree.t commands expects them to be.

rake tasks removing existing translations

I used this rake tasks to synchronize and update my translations to newest spree defaults:

  1. rake spree_i18n:update_default
  2. rake spree_i18n:sync

After doing so all model and attributes translation were lost and resetted to the default value.
Thats because you namespaced the models and therefore the translation keys were changed from i.e product: to spree/product

Please fix the sync task to understand the namespace, otherwise all the translation effort from past years are obsolet!

can not load translations from ... expected it to return a hash, but does not

Hi

I do fresh fork 3 day ago, then I do
bundle exec rake spree_i18n:update_default
and then
bundle exec rake spree_i18n:sync

After it I'm getting I18n::InvalidLocaleData error for each locale file:
can not load translations from /home/matin/RailsProjects/GITHUB/spree_i18n/lib/spree_i18n/../../config/locales/da.yml, expected it to return a hash, but does not

I do yaml check using http://yaml-online-parser.appspot.com/, there are errors on lines 53 - 62:
spree/order/bill_address:
--address1: "Billing address street"
----city: "Billing address city"
----firstname: "Billing address first name"

But it should look like:
spree/order/bill_address:
--address1: "Billing address street"
--city: "Billing address city"
--firstname: "Billing address first name"

Note the wrong identation of city

Martin

NoMethodError in Spree/admin/overview#index

Hi there, i used your russian translation for my spree magazine and get error, full source:

NoMethodError in Spree/admin/overview#index

Showing /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/spree_core-1.3.2/app/views/spree/admin/shared/_translations.html.erb where line #16 raised:

undefined method `reject' for "translation missing: ru.date.month_names":String

Extracted source (around line #16):

13:     :destroy             => I18n.t(:destroy),
14:     :edit                => I18n.t(:edit),
15:     :loading             => I18n.t(:loading),
16:     :month_names         => I18n.t(:month_names, :scope => :date).reject(&:blank?),
17:     :more                => I18n.t(:more),
18:     :name                => I18n.t(:name),
19:     :next                => I18n.t(:next),

Trace of template inclusion: /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/spree_core-1.3.2/app/views/spree/admin/shared/_head.html.erb, /opt/bitnami/ruby/lib/ruby/gems/1.9.1/gems/spree_core-1.3.2/app/views/spree/layouts/admin.html.erb

This error occurs only when i enter on site's dushboard. Seems to be that sree searches for translations of month names, which are not in ru.yml. Adding "date" section from another translation file seems to fix all errors.

dependency on 'spree'

this gem depends on the whole 'spree' gem.
can it be more specific, like 'spree_core' or something, so i can translate the core but avoid to load, for example, spree_promo?

thanks

undefined method `/' for nil:NilClass

Attempt to devide a nill with 2 results in exception.

My hunch:
Debugging lead me to ja.yml line 1111 being read, causing this error. The translation is ~ (tilde) which seems to fail in the `create_hash' string parsing.

I cannot confirm this, and someone needs to dig deeper though.

Trace:

** Invoke spree_i18n:sync (first_time)
** Execute spree_i18n:sync
Starting syncronization...
rake aborted!
undefined method`/' for nil:NilClass
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/spree/i18n_utils.rb:21:in `create_hash'
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/spree/i18n_utils.rb:17:in`each'
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/spree/i18n_utils.rb:17:in `create_hash'
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/spree/i18n_utils.rb:7:in`read_file'
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/tasks/i18n.rake:37
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/tasks/i18n.rake:35:in `each'
/home/ber/Documenten/ANT_annatreurniet/gems/spree_i18n/lib/tasks/i18n.rake:35
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in`call'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in`each'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in`invoke_with_call_chain'
/home/ber/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in`invoke_with_call_chain'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in`invoke_task'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in`each'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in`standard_exception_handling'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in`run'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in`run'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/gems/rake-0.9.2.2/bin/rake:33
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/bin/rake:19:in `load'
/home/ber/.rvm/gems/ruby-1.8.7-p302@ANT_spree_1/bin/rake:19
Tasks: TOP => spree_i18n:sync

switch locale on frontend

I've added gem "spree_i18n", :git => "git://github.com/spree/spree_i18n.git" to my Gemfile
after that
bundle install

But I dont find how can I switch a locale

I also have tried to write:

before_filter :choose_locale

def choose_locale
I18n.locale = :da
end

but switching it still doesn't help. Should I do smth differently?

i18n-spec 4.0 breaks spree_i18n.

I did a fresh remote update from master branch to see if same issue occur here also that I had when adding i18n-spec validations to spree_static_content extension. I even did a rvm gemset empty spree_i18n to make sure everything was fresh.

And yes! Its failing when I do: bundle exec rake app_test

Error:

Generating dummy Rails application...
rake aborted!
uninitialized constant RSpec::Matchers
/Users/futhr/.rvm/gems/ruby-1.9.3-p385@spree_i18n/gems/i18n-spec-0.4.0/lib/i18n-spec/matchers/be_a_complete_translation_of_matcher.rb:1:in `<top (required)>'

It also say:

Thor has already been required. This may cause Bundler to malfunction in unexpected ways.

This is actually true, sometimes specs fails random due to this!
I notice this comes from the Rake file setup that is actually generated from new extensions within rails. To avoid dual require of Thor message I have to revert to old Rake file style.

fix fr translations

some errors in translations

payment_processing_failed: "Le paiement ne peut être effectué, merci de vérifier les informations fournies"
payment_processor_choose_banner_text: "Si vous avez besoin d'aide pour schoisir une méthode de paiement, svp visitez"
payment_processor_choose_link: "notre page de paiements"

Not working for Spree edge

I'm getting this error trying a bundle update:

Could not find gem 'spree (~> 1.1) ruby', which is required by gem 'spree_i18n (>= 0) ruby', in any of the sources.

Is there a working version for spree edge, or what can I do?

Google fonts problem

Request URL:http://themes.googleusercontent.com/static/fonts/opensans/v6/uYKcPVoh6c5R0NpdEY5A-Q.woff
Request Method:GET
Status Code:504 Gateway Time-out

Pluralization validation

match_choices.one in locale's yml mess up pluralization validation. one and other should be treated as reserved words. Maybe change one to single ... or wan (phonetic/jp) ;) to make it pass.

spree_sample:load doesn't translate after using globalize3

New spree_i18n use globalize3 to translate model data. But spree_sample:load will always
run after create_translation_table! migration. So new loaded sample data is not translated to
my default_locale zh-TW but always en.
I got problem like this after load sample data because route can't found permalink
of zh-TW locale in translation table.
No route matches {:controller=>"spree/taxons", :action=>"show", :id=>nil}

Here is my workaround:
https://gist.github.com/wuboy0307/5840585
The workaround is doing drop_translation_table! and create_translation_table! again after spree_sample:load. However, it would be better not to drop and create translation table since there may be some data in it already. Maybe call move_data_to_translation_table method in lib/globalize/active_record/migration.rb directly after spree_sample:load.

problem with installing

Hello, when i run rails g spree:site i have error:

/var/home/.../projects/bob-gold/shared/gems/ruby/1.9.1/gems/i18n-0.6.1/lib/i18n/backend/base.rb:158:in `load_file': can not load translations from /var/home/.../projects/bob-gold/shared/gems/ruby/1.9.1/bundler/gems/spree_i18n-fd017af18d8f/config/locales/et.yml, expected it to return a hash, but does not (I18n::InvalidLocaleData)

In my configuration file set "ru" locale, can u help me?

JavaScript does not work in admin interface.

I installed spree_i18n with default settings and I set config.i18n.default_locale = :ja in coufig/application.rb .
After restarting server, translated messages are shown successfully.

But JavaScript does not work so I can't set zones, shipping methods, etc...
This problem also occurs other locales(:de, :ru, :fr, etc...) but :en.

My Gemfile around spree is below

gem 'spree', github: 'spree/spree', branch: '2-0-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', branch: "2-0-stable"
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '3-0-stable'

Gem dependency "rails_i18n"

Since commit cbf1535 I can not run bundle update any more, it fails with this error:

Could not find gem 'rails_i18n (>= 0) ruby', which is required by gem 'spree_i18n (>= 0) ruby', in any of the sources.

I think this is because the correct name of the gem is "rails-i18n", not "rails_i18n".

Regards
groe

Most locales are not loaded

Gemfile (part of):

gem 'rails', '3.2.3'
gem 'spree'
gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git'

What I see:

$ rails c
$ I18n.available_locales
=> [:en, :ja, :"en-AU", :es, :ru]

What I expect to see:

Several dozen locales.

I think the problem was introduced in this commit. If I reference a specific ref in the Gemfile that corresponds to the version of the code before that change everything is ok:

gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git', :ref => "f662502aa6a172c7de0dea5b84e1e46b6db9418f"

$ rails c
$ I18n.available_locales.count
=> 35

Setting the default_locale to another value than :en breaks taxon trees in backend

I manually added Spree 2-0-stable to my Rails 3.2.13 application.
Then changed the default_locale in config/application.rb to another language:
config.i18n.default_locale = :de

The Frontend and Backend renders in the chosen language, but the jstree functionality in Taxon Trees seems to be broken.
When editing a taxonomy the tree does not show up.
Uncaught TypeError: Object # has no method 'hasClass' jquery.jstree.js:671

The error disappears when the default_locale is not set or set to :en.

i've also tried config.i18n.fallbacks = true, but that does not help.

My Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'mysql2'

group :assets do
gem 'sass-rails', '> 3.2.3'
gem 'coffee-rails', '
> 3.2.1'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', '~> 2.0'

gem 'spree', github: 'spree/spree', branch: '2-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-0-stable'
gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git', :branch => "3-0-stable"

The installed gems in my bundle:

  • actionmailer (3.2.13)
  • actionpack (3.2.13)
  • active_utils (1.0.5)
  • activemerchant (1.33.0)
  • activemodel (3.2.13)
  • activerecord (3.2.13)
  • activeresource (3.2.13)
  • activesupport (3.2.13)
  • acts_as_list (0.2.0)
  • arel (3.0.2)
  • awesome_nested_set (2.1.5)
  • aws-sdk (1.3.9)
  • bcrypt-ruby (3.0.1)
  • builder (3.0.4)
  • bundler (1.3.5)
  • cancan (1.6.8)
  • climate_control (0.0.3)
  • cocaine (0.5.1)
  • coffee-rails (3.2.2)
  • coffee-script (2.2.0)
  • coffee-script-source (1.6.2)
  • deface (0.9.1)
  • devise (2.2.4)
  • devise-encryptable (0.1.2)
  • erubis (2.7.0)
  • execjs (1.4.0)
  • ffaker (1.16.1)
  • globalize3 (0.3.0)
  • highline (1.6.18)
  • hike (1.2.3)
  • httparty (0.11.0)
  • i18n (0.6.1)
  • journey (1.0.4)
  • jquery-rails (2.2.2)
  • json (1.8.0)
  • kaminari (0.13.0)
  • libv8 (3.11.8.17)
  • mail (2.5.4)
  • mime-types (1.23)
  • money (5.1.1)
  • multi_json (1.7.7)
  • multi_xml (0.5.4)
  • mysql2 (0.3.11)
  • nokogiri (1.5.10)
  • orm_adapter (0.4.0)
  • paper_trail (2.7.2)
  • paperclip (3.4.2)
  • polyamorous (0.5.0)
  • polyglot (0.3.3)
  • rabl (0.8.4)
  • rack (1.4.5)
  • rack-cache (1.2)
  • rack-ssl (1.3.3)
  • rack-test (0.6.2)
  • rails (3.2.13)
  • rails-i18n (0.7.3)
  • railties (3.2.13)
  • rake (10.0.4)
  • ransack (0.7.2)
  • rdoc (3.12.2)
  • ref (1.0.5)
  • sass (3.2.9)
  • sass-rails (3.2.6)
  • select2-rails (3.2.1)
  • spree (2.0.3.beta 3107089)
  • spree_api (2.0.3.beta)
  • spree_auth_devise (2.0.0 b2181e3)
  • spree_backend (2.0.3.beta)
  • spree_cmd (2.0.3.beta)
  • spree_core (2.0.3.beta)
  • spree_frontend (2.0.3.beta)
  • spree_i18n (3.1.0.beta c2d577b)
  • spree_sample (2.0.3.beta)
  • sprockets (2.2.2)
  • state_machine (1.2.0)
  • stringex (1.5.1)
  • therubyracer (0.11.4)
  • thor (0.18.1)
  • tilt (1.4.1)
  • treetop (1.4.14)
  • truncate_html (0.9.2)
  • tzinfo (0.3.37)
  • uglifier (2.1.1)
  • uuidtools (2.1.4)
  • versioncake (1.0.0)
  • warden (1.2.1)

Japanese locale should be called ja.yml?

Hi,

I was just wondering why the Japanese translation has the filename jp.yml when ja is the iso language code.

Correct me if I'm wrong but the locales should use the language iso first, then the country iso? like _

I understand that this would break anyone already using this... but i though it was worth discussing as it would make it more compatible.

At the moment i have this in my template to get around this issue:

!!! Strict
%html{html_attrs(I18n.locale.to_s == 'jp' ? 'ja' : I18n.locale)}
  %head

Refrences:
http://www.w3schools.com/tags/ref_language_codes.asp
https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/ja.yml

Translation missing: no_payment_methods_available

This may not be an issue, I'm having trouble getting to grips with i18n and spree which will be solved as I read, try things and learn more. However, I had one error this afternoon which may be of interest to someone here:

translation missing: en-GB.activerecord.errors.models.spree/order.attributes.base.no_payment_methods_available

This appeared in the shopping cart. I solved the cause, just the missing translation I thought might be relevant.

Hope that helps,
Steve

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.