-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some translations are returned as hash after 1.7.1 #510
Comments
Is this still an issue in 1.8.1? |
Still having this issue with 1.8.1
|
Could you please provide the locale files that you're using? Well, just the relevant parts. That would help me debug this. |
I created a new rails app and added a simple i18n yaml to showcase this issue: https://github.com/ydkn/ruby-i18n-issue-510 It has no views but you can test it using the rails console like the example above:
|
Thank you. I have confirmed this is indeed broken in 1.8.1. My guess is b7f69f7 is responsible. I will look more into this later on. |
This fix for this has been applied in 1b5e345. Thank you very much for letting me know about the issue and providing some really awesome steps to reproduce it. The fix has been released in i18n 1.8.2. Please upgrade to this version in your applications. |
Unfortunately in my case the error seems to be still there. Here is another example: v 1.8.2 v 1.7.0 |
This is still an issue if you've formatted translations like this:
It seems that translations related to the model, but not necessarily attributes of the model, are nested under the model-key. |
@chevinbrown Please open a new issue for this, even if it is related. The fix itself may be separate, and so it helps to track that with separate issue numbers. |
What I tried to do
I am developing a Rails 5.2 app with English and Italian languages.
The translations of some model names fail after updating i18n from 1.7.0 to 1.7.1.
Reverting to 1.7.0 fixed the issue.
What I expected to happen
PurchaseOrder.model_name.human count:1
=> "Ordine di acquisto"
PurchaseOrder.model_name.human count:2
=> "Ordini di acquisto"
What actually happened
PurchaseOrder.model_name.human count: 1
=> {:one=>"Ordine di acquisto", :other=>"Ordini di acquisto", :limit_order=>"Ordine al limite", :market_order=>"Ordine a mercato", :order_total=>"Totale ordine", :recurring_order=>{:one=>"Ordine ricorrente", :other=>"Ordini ricorrenti"}, :open=>"Ordini aperti", :reorder=>"Riordina"}
PurchaseOrder.model_name.human count: 2
=> {:one=>"Ordine di acquisto", :other=>"Ordini di acquisto", :limit_order=>"Ordine al limite", :market_order=>"Ordine a mercato", :order_total=>"Totale ordine", :recurring_order=>{:one=>"Ordine ricorrente", :other=>"Ordini ricorrenti"}, :open=>"Ordini aperti", :reorder=>"Riordina"}
Versions of i18n, rails, and anything else you think is necessary
Rails 5.2.4
i18n 1.7.1
Issue is solved reverting to 1.7.0
The text was updated successfully, but these errors were encountered: