diff --git a/mpw-ssh b/mpw-ssh index c1b42a6..0e9db73 100755 --- a/mpw-ssh +++ b/mpw-ssh @@ -6,11 +6,21 @@ require 'rubygems' require 'optparse' require 'pathname' +require 'locale' +require 'i18n' APP_ROOT = File.dirname(Pathname.new(__FILE__).realpath) 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] options = {}