mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-17 08:30:04 +00:00
fix bug translation
This commit is contained in:
parent
745d3e82c5
commit
787cdf0b50
4 changed files with 5 additions and 7 deletions
|
@ -40,7 +40,6 @@ class Cli
|
|||
if !File.exist?("#{APP_ROOT}/i18n/#{language}.yml")
|
||||
language= 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{language}.yml"]
|
||||
I18n.locale = language.to_sym
|
||||
|
||||
if @m.setup(key, language, file_gpg, timeout_pwd)
|
||||
|
|
|
@ -29,7 +29,7 @@ class MPW
|
|||
@error_msg = nil
|
||||
@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
|
||||
end
|
||||
end
|
||||
|
@ -85,12 +85,11 @@ class MPW
|
|||
@error_msg = I18n.t('error.config.check')
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if !@lang.nil? && !@lang.empty?
|
||||
if !File.exist?("#{APP_ROOT}/i18n/#{@lang}.yml")
|
||||
language= 'en_US'
|
||||
@lang = 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{@lang}.yml"]
|
||||
I18n.locale = @lang.to_sym
|
||||
end
|
||||
|
||||
|
|
2
mpw
2
mpw
|
@ -18,7 +18,7 @@ lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
|
|||
if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml")
|
||||
lang = 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{lang}.yml"]
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/*.yml"]
|
||||
I18n.locale = lang.to_sym
|
||||
|
||||
options = {}
|
||||
|
|
2
mpw-ssh
2
mpw-ssh
|
@ -17,7 +17,7 @@ lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
|
|||
if !File.exist?("#{APP_ROOT}/i18n/#{lang}.yml")
|
||||
lang = 'en'
|
||||
end
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/#{lang}.yml"]
|
||||
I18n.load_path = Dir["#{APP_ROOT}/i18n/*.yml"]
|
||||
I18n.locale = lang.to_sym
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue