check_language.rb: Added basepath (script is now callable from everywhere)

This commit is contained in:
Sebastian Kaspari 2010-09-23 12:03:38 +02:00
parent 14a76d2c95
commit 5df472fe11
1 changed files with 4 additions and 5 deletions

View File

@ -19,8 +19,6 @@
# along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
# 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}"