Move another method into the StringsRow class.
This commit is contained in:
parent
6612d01e48
commit
4399266aeb
4 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in a new issue