Skip to content
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

Incorrect use of _state instead of _states for I18n in state changes #8511

Open
leemour opened this issue Dec 8, 2017 · 1 comment
Open

Comments

@leemour
Copy link
Contributor

leemour commented Dec 8, 2017

There is a mixup or singular/plural _state/_states forms in views.

I have config.action_view.raise_on_missing_translations = true
When accessing order state_changes ( e.g. /admin/orders/R074278336/state_changes) I get an error:

I18n::MissingTranslationData in Spree::Admin::StateChanges#index
Showing /home/leemour/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spree_backend-3.4.1/app/views/spree/admin/state_changes/index.html.erb where line 25 raised:
translation missing: ru.spree.shipment_state.backorder

In locale files, shipment_state is a string, not a hash containing backorder and translates to the equivalent of 'Shipment State'.
There is shipment_states (plural form) entry in locale files that contains backorder and this is the right I18n scope that should be used. The same is with payment_states.
Singular forms (_state) are used in views for translation and are supposed to have string value as in locale files. While plural forms (_states) are used as scopes to translated nested entries (states). There is just another mixup with order_state though, it should be changed to order_states in locale files to be consistent.

I'll include a PR with fixes that make this I18n scopes consistent. I hope you will accept it.
#8512

@githubble01
Copy link

@damianlegawiec and @leemour: After having worked on #854 in spree_i18n, I really think that resolving this issue would be of great value to all the translation contributers out there.

How would we go about this?
BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants