3

I would like to know the standard code for Chinese language in the available locales of I18n standards. For example :en for English. Also tell me how to name the yml file for chinese langauge (en.yml for English).

adding zh.yml into /config/locales/ and specifying code for chinese as :zh is not working.

I18n.available_locales in rails console gives only the below lines.

irb(main):022:0> I18n.available_locales
=> [:ar, :en, :de]

I couldn't see :zh there inside. How we can include chinese translation code inside this?

Thanks :)-

Rajesh Omanakuttan
  • 6,788
  • 7
  • 47
  • 85

1 Answers1

5

if you are looking for the simplified chinese, it is zh-CN. For the traditional zh-TW.

gillien
  • 402
  • 2
  • 15
  • 1
    Still adding this file `zh-TW.yml` -- my app can't seem to find it. – Trip Mar 14 '16 at 12:40
  • I don't get it, it says right in the [docs](http://guides.rubyonrails.org/i18n.html) "including only the locale ("language") part, like :en, :pl, not the region part, like :en-US or :en-GB" but `:zh` doesn't seem to work, only `'zh-CN'`? – nrser Jun 19 '17 at 09:37