If there's not a default (developer language) translation, warn but still insert it

This commit is contained in:
Kevin Everets 2012-02-08 17:17:28 -05:00
parent 0fa9c72dad
commit d260346c17

View file

@ -120,13 +120,17 @@ module Twine
f.puts "[[#{section.name}]]"
section.rows.each do |row|
f.puts "\t[#{row.key}]"
value = row.translations[dev_lang]
if value[0,1] == ' ' || value[-1,1] == ' ' || (value[0,1] == '`' && value[-1,1] == '`')
value = '`' + value + '`'
if !value
puts "Warning! #{row.key} does not exist in #{dev_lang}"
else
if value[0,1] == ' ' || value[-1,1] == ' ' || (value[0,1] == '`' && value[-1,1] == '`')
value = '`' + value + '`'
end
f.puts "\t\t#{dev_lang} = #{value}"
end
f.puts "\t[#{row.key}]"
f.puts "\t\t#{dev_lang} = #{value}"
if row.tags && row.tags.length > 0
tag_str = row.tags.join(',')
f.puts "\t\ttags = #{tag_str}"