1
0
Fork 0
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:
adrien 2013-12-26 10:47:54 +01:00
parent 105467f108
commit f600ff024b
4 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
---
en_US:
en:
error:
add:
name_empty: "You must define a name!"

View file

@ -1,5 +1,5 @@
---
fr_FR:
fr:
error:
add:
name_empty: "Vous devez définir un nom!"

View file

@ -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
View file

@ -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