Added polish translation (Tomasz Gawryl).
Added a gloc task to update lang files based on the english file content. git-svn-id: http://redmine.rubyforge.org/svn/trunk@749 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
384cbadce6
commit
fe7c0d6484
11 files changed
+689
No files matched your search
+23
@@ -27,4 +27,27 @@ namespace :gloc do
|
||||
puts count.keys.sort.map{|x|" WARNING: Duplicate key '#{x}' (#{count[x]} occurances)"}.join("\n") unless count.empty?
|
||||
}
|
||||
end
|
||||
|
||||
desc 'Updates language files based on em.yml content'
|
||||
task :update do
|
||||
dir = ENV['DIR'] || './lang'
|
||||
|
||||
en_strings = {}
|
||||
en_file = File.open(File.join(dir,'en.yml'), 'r')
|
||||
en_file.each_line {|line| en_strings[$1] = $2 if line =~ %r{^([\w_]+):\s(.+)$} }
|
||||
en_file.close
|
||||
|
||||
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
||||
files.each do |file|
|
||||
puts "Updating file #{file}"
|
||||
keys = IO.readlines(file).collect {|line| $1 if line =~ %r{^([\w_]+):\s(.+)$} }.compact
|
||||
lang = File.open(file, 'a')
|
||||
en_strings.each do |key, str|
|
||||
next if keys.include?(key)
|
||||
puts "added: #{key}"
|
||||
lang << "#{key}: #{str}\n"
|
||||
end
|
||||
lang.close
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user