amatsuda / i18n_generators

A pack of Rails generators gem plugin that generates Rails 3 and Rails 2 I18n locale files for almost every known locale.
http://github.com/amatsuda/i18n_generators
MIT License
296 stars 29 forks source link

Fix generating default locale including hyphen #24

Closed AmatsukiKu closed 5 years ago

AmatsukiKu commented 5 years ago

I fixed I18nLocaleGenerator#add_locale_config when the locale includes a hyphen (e.g.: zh-CN).

rails g i18n_locale zh-CN expects to generate

# config/application.rb
config.i18n.default_locale = :'zh-CN'

but now, generates

config.i18n.default_locale = :zh-CN

I guess that this behavior continues since https://github.com/amatsuda/i18n_generators/commit/7f6841f8e641c52d236174306c5d888474ccdb36

amatsuda commented 5 years ago

@AmatsukiKu Thank you!!