Fix crash when default language is missing for a string.
Fixes issue #13
This commit is contained in:
parent
5604965618
commit
144e693aa7
1 changed files with 13 additions and 11 deletions
|
@ -100,19 +100,21 @@ module Twine
|
|||
key = key.gsub('"', '\\\\"')
|
||||
|
||||
value = row.translated_string_for_lang(lang, default_lang)
|
||||
value = value.gsub('"', '\\\\"')
|
||||
if value
|
||||
value = value.gsub('"', '\\\\"')
|
||||
|
||||
comment = row.comment
|
||||
if comment
|
||||
comment = comment.gsub('*/', '* /')
|
||||
comment = row.comment
|
||||
if comment
|
||||
comment = comment.gsub('*/', '* /')
|
||||
end
|
||||
|
||||
if comment && comment.length > 0
|
||||
f.print "/* #{comment} */\n"
|
||||
end
|
||||
|
||||
f.print "\"#{key}\" = \"#{value}\";\n"
|
||||
end
|
||||
|
||||
if comment && comment.length > 0
|
||||
f.print "/* #{comment} */\n"
|
||||
end
|
||||
|
||||
f.print "\"#{key}\" = \"#{value}\";\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Reference in a new issue