mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +00:00
language code more simple
This commit is contained in:
parent
105467f108
commit
f600ff024b
4 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
en_US:
|
||||
en:
|
||||
error:
|
||||
add:
|
||||
name_empty: "You must define a name!"
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
fr_FR:
|
||||
fr:
|
||||
error:
|
||||
add:
|
||||
name_empty: "Vous devez définir un nom!"
|
|
@ -38,7 +38,7 @@ class Cli
|
|||
timeout_pwd = ask(I18n.t('cli.form.setup.timeout'))
|
||||
|
||||
if !File.exist?("#{APP_ROOT}/i18n/#{language}.yml")
|
||||
language= 'en_US'
|
||||
language= 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{language}.yml"]
|
||||
I18n.locale = language.to_sym
|
||||
|
|
4
mpw
4
mpw
|
@ -13,10 +13,10 @@ APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
|
|||
require "#{APP_ROOT}/lib/Cli.rb"
|
||||
|
||||
|
||||
lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s
|
||||
lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
|
||||
|
||||
if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml")
|
||||
lang = 'en_US'
|
||||
lang = 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{lang}.yml"]
|
||||
I18n.locale = lang.to_sym
|
||||
|
|
Loading…
Reference in a new issue