1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

fix bug translation

This commit is contained in:
nishiki 2013-12-30 21:00:07 +01:00
parent 745d3e82c5
commit 787cdf0b50
4 changed files with 5 additions and 7 deletions

View file

@ -40,7 +40,6 @@ class Cli
if !File.exist?("#{APP_ROOT}/i18n/#{language}.yml") if !File.exist?("#{APP_ROOT}/i18n/#{language}.yml")
language= 'en' language= 'en'
end end
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{language}.yml"]
I18n.locale = language.to_sym I18n.locale = language.to_sym
if @m.setup(key, language, file_gpg, timeout_pwd) if @m.setup(key, language, file_gpg, timeout_pwd)

View file

@ -29,7 +29,7 @@ class MPW
@error_msg = nil @error_msg = nil
@file_config = "#{Dir.home()}/.mpw.cfg" @file_config = "#{Dir.home()}/.mpw.cfg"
if !file_config.nil? && !file_config.empty? && File.exist?(file_config) if !file_config.nil? && !file_config.empty?
@file_config = file_config @file_config = file_config
end end
end end
@ -85,12 +85,11 @@ class MPW
@error_msg = I18n.t('error.config.check') @error_msg = I18n.t('error.config.check')
return false return false
end end
if !@lang.nil? && !@lang.empty? if !@lang.nil? && !@lang.empty?
if !File.exist?("#{APP_ROOT}/i18n/#{@lang}.yml") if !File.exist?("#{APP_ROOT}/i18n/#{@lang}.yml")
language= 'en_US' @lang = 'en'
end end
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{@lang}.yml"]
I18n.locale = @lang.to_sym I18n.locale = @lang.to_sym
end end

2
mpw
View file

@ -18,7 +18,7 @@ lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml") if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml")
lang = 'en' lang = 'en'
end end
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{lang}.yml"] I18n.load_path = Dir["#{APP_ROOT}/i18n/*.yml"]
I18n.locale = lang.to_sym I18n.locale = lang.to_sym
options = {} options = {}

View file

@ -17,7 +17,7 @@ lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml") if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml")
lang = 'en' lang = 'en'
end end
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{lang}.yml"] I18n.load_path = Dir["#{APP_ROOT}/i18n/*.yml"]
I18n.locale = lang.to_sym I18n.locale = lang.to_sym