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

i18n problem of 'state' #7534

Closed
orbit-dna opened this issue Aug 15, 2016 · 4 comments
Closed

i18n problem of 'state' #7534

orbit-dna opened this issue Aug 15, 2016 · 4 comments

Comments

@orbit-dna
Copy link
Contributor

orbit-dna commented Aug 15, 2016

In these files:

  1. backend/app/views/spree/admin/adjustments/_adjustments_table.html.erb #11
    <th class="text-center"><%= Spree.t(:state) %></th>
  2. backend/app/views/spree/admin/shared/_address_form.html.erb #56
    <%= f.label :state_id, Spree.t(:state) %>
  3. backend/app/views/spree/admin/stock_locations/_form.html.erb #80
    <%= f.label :state_id, Spree.t(:state) %>
  4. backend/app/views/spree/admin/stock_locations/index.html.erb #14
    <th><%= Spree.t(:state) %></th>

there are some Spree.t(:state)s, however, these :state have different meaning:

  • in 1 and 4, it means kind of status,
  • in 2 and 3, it means like province/country.

while the word state has these two meanings in English, but when translated, other language may have to use 2 words.
So, should these :state be split?

other files found using Spree.t(:state):

@damianlegawiec
Copy link
Member

@orbit-dna good catch. For state_id I think we can use Spree::State.model_name.human

@krtschmr
Copy link
Contributor

krtschmr commented Aug 15, 2016

That's the reason why we kept Admin in english langauge rather then german. So many things got a Bundesland, it was so confusing

If anybody wants to switch language, use this:

Spree::BaseController.class_eval do
  before_filter {
    I18n.locale = :en if admin_namespace?
  }

  def namespace
    self.class.to_s.split("::")[1]
  end

  def admin_namespace?
    namespace == "Admin"
  end

@orbit-dna
Copy link
Contributor Author

@damianlegawiec nice, that works for me.
@krtschmr nice idea. but our people not used to english, have to localize.

@damianlegawiec
Copy link
Member

@orbit-dna please submit a PR with this change if you can, thanks! 👍

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

3 participants