Class: PolyglotFlutter::Resource::TranslationKey

Inherits:
Base
  • Object
show all
Defined in:
lib/flutter_polyglot_cli/api/translation_key.rb

Constant Summary

Constants included from Helper::Depaginate

Helper::Depaginate::PER_PAGE

Instance Method Summary collapse

Methods inherited from Base

depaginate, token

Methods included from Helper::Depaginate

#depaginate_query

Instance Method Details

#clean_translation(language) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/flutter_polyglot_cli/api/translation_key.rb', line 4

def clean_translation(language)
  translation_value = name
  translation = translations.find { |key| key.language.id == language.id }
  translation_value = translation.value if translation&.value
  escape_translation(translation_value)
  if translation_value.include? '%'
    translation_value = convert_aruments(translation_value)
  end
  translation_value
end