Skip to content

Error with Chinese translations and datetime_select #254

Closed
mihaj opened this Issue Aug 29, 2012 · 4 comments

2 participants

@mihaj
mihaj commented Aug 29, 2012

Hi.

I have an app that contains en.yml and cn.yml which both contain equal amount of translations. With en.yml i dont have any problems, but with cn.yml I have problems with datetime_select control.

I get: undefined method `-' for "translation missing: cn.date.order":String

If I add cn.date.order i get: undefined method `-' for "some text":String

How can I fix that?

Thanks

PS: I am using ruby 1.9.3 and ROR 3.0.17

@kuroda
Collaborator
kuroda commented Aug 30, 2012

@mihaj

Do you mean zh-CN? We don't have a locale named cn.

@mihaj
mihaj commented Aug 30, 2012

Hi kuroda!

I've changed to zh-CN and i get the same thing: undefined method `-' for "translation missing: zh-CN.date.order":String

@kuroda
Collaborator
kuroda commented Aug 30, 2012

@mihaj

Do you have gem 'rails-i18n' in your Gemfile?

This error message shows that the date.order entry is missing from the zh-CN locale.

If you want to solve this by adding date.order entry to your own locale file, you should give it an array like as:

  date:
    order:
    - :year
    - :month
    - :day
@mihaj
mihaj commented Aug 30, 2012

@kuroda

I've added the text to locale file and now it works fine. I dont have gem 'rails-i18n' in the Gemfile.

@kuroda kuroda closed this Aug 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.