mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
add i18n
This commit is contained in:
parent
f600ff024b
commit
3dcb465025
1 changed files with 11 additions and 1 deletions
12
mpw-ssh
12
mpw-ssh
|
@ -6,11 +6,21 @@
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
require 'pathname'
|
require 'pathname'
|
||||||
|
require 'locale'
|
||||||
|
require 'i18n'
|
||||||
|
|
||||||
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
|
APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath)
|
||||||
require "#{APP_ROOT}/lib/CliSSH.rb"
|
require "#{APP_ROOT}/lib/CliSSH.rb"
|
||||||
|
|
||||||
cli = CliSSH.new()
|
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.locale = lang.to_sym
|
||||||
|
|
||||||
|
cli = CliSSH.new(lang)
|
||||||
search = ARGV[0]
|
search = ARGV[0]
|
||||||
|
|
||||||
options = {}
|
options = {}
|
||||||
|
|
Loading…
Reference in a new issue