Move another method into the StringsRow class.

This commit is contained in:
Sebastian Celis 2012-02-09 09:48:08 -06:00
parent 6612d01e48
commit 4399266aeb
4 changed files with 6 additions and 6 deletions

View file

@ -33,10 +33,6 @@ module Twine
end
end
end
def translated_string_for_row_and_lang(row, lang, default_lang)
row.translations[lang] || row.translations[default_lang]
end
end
end
end

View file

@ -89,7 +89,7 @@ module Twine
key = row.key
key = CGI.escapeHTML(key)
value = translated_string_for_row_and_lang(row, lang, default_lang)
value = row.translated_string_for_and_lang(lang, default_lang)
value.gsub!('\'', '\\\\\'')
value.gsub!('%@', '%s')
value = CGI.escapeHTML(value)

View file

@ -63,7 +63,7 @@ module Twine
key = row.key
key = key.gsub('"', '\\\\"')
value = translated_string_for_row_and_lang(row, lang, default_lang)
value = row.translated_string_for_and_lang(lang, default_lang)
value = value.gsub('"', '\\\\"')
comment = row.comment

View file

@ -38,6 +38,10 @@ module Twine
return false
end
def translated_string_for_lang(lang, default_lang=nil)
row.translations[lang] || row.translations[default_lang]
end
end
class StringsFile