class PolyglotIos::Resource::TranslationKey
Public Instance Methods
clean_translation(language)
click to toggle source
# File lib/ios_polyglot_cli/api/translation_key.rb, line 5 def clean_translation(language) translation_value = name translation = translations.find { |key| key.language.id == language.id } if translation && translation.value translation_value = translation.value end escape_translation(translation_value) end
Private Instance Methods
escape_translation(translation)
click to toggle source
# File lib/ios_polyglot_cli/api/translation_key.rb, line 16 def escape_translation(translation) translation .gsub("\"", "\\\"") .gsub("%s", "%@") end