From 5df472fe11ae0df25792e1777435c1084461a688 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Thu, 23 Sep 2010 12:03:38 +0200 Subject: [PATCH] check_language.rb: Added basepath (script is now callable from everywhere) --- tools/check_language.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/check_language.rb b/tools/check_language.rb index 01986b1..b0c7fd1 100755 --- a/tools/check_language.rb +++ b/tools/check_language.rb @@ -19,8 +19,6 @@ # along with Yaaic. If not, see . # TODO: Maybe check all existing languages instead of using a paremter -# TODO: Add a basepath to the files (this script should be callable from -# everyhwere # TODO: Use a XML parser instead of reading lines if ARGV.length != 1 then @@ -28,10 +26,11 @@ if ARGV.length != 1 then exit end -language = ARGV[0] +base_path = File.dirname(__FILE__) +language = ARGV[0] -original_file = "../res/values/strings.xml" -language_file = "../res/values-#{language}/strings.xml" +original_file = "#{base_path}/../res/values/strings.xml" +language_file = "#{base_path}/../res/values-#{language}/strings.xml" if !File.exists? language_file then puts "File does not exists: #{language_file}"