Class: PhraseApp::RequestParams::LocaleDownloadParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::LocaleDownloadParams
- Defined in:
- lib/phraseapp-ruby.rb
Overview
LocaleDownloadParams
Parameters:
- convert_emoji
-
Indicates whether Emoji symbols should be converted to actual Emojis. <a href=“guides/working-with-phraseapp/emoji-support/”>Working with Emojis</a>.
- encoding
-
Specify an encoding for the locale file. See the <a href=“guides/formats”>format guide</a> for a list of supported encodings for each format.
- fallback_locale_id
-
If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the public ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to
true. - file_format
-
File format name. See the format guide for all supported file formats.
- format_options
-
Additional formatting and render options. See the <a href=“guides/formats”>format guide</a> for a list of options available for each format. Specify format options like this:
...&format_options[foo]=bar - include_empty_translations
-
Indicates whether keys without translations should be included in the output as well.
- keep_notranslate_tags
-
Indicates whether [NOTRANSLATE] tags should be kept.
- skip_unverified_translations
-
Indicates whether the locale file should skip all unverified translations.
- tag
-
Limit result to keys tagged with the given tag (identified by its name).
Instance Method Summary collapse
- #convert_emoji=(val) ⇒ Object
- #encoding=(val) ⇒ Object
- #fallback_locale_id=(val) ⇒ Object
- #file_format=(val) ⇒ Object
- #format_options=(val) ⇒ Object
- #include_empty_translations=(val) ⇒ Object
- #keep_notranslate_tags=(val) ⇒ Object
- #skip_unverified_translations=(val) ⇒ Object
- #tag=(val) ⇒ Object
- #to_h ⇒ Object
- #validate ⇒ Object
Instance Method Details
#convert_emoji=(val) ⇒ Object
1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'lib/phraseapp-ruby.rb', line 1338 def convert_emoji=(val) if val.is_a?(TrueClass) self.convert_emoji = true elsif val.is_a?(FalseClass) #ignore self.convert_emoji = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#encoding=(val) ⇒ Object
1348 1349 1350 |
# File 'lib/phraseapp-ruby.rb', line 1348 def encoding=(val) self.encoding = val end |
#fallback_locale_id=(val) ⇒ Object
1352 1353 1354 |
# File 'lib/phraseapp-ruby.rb', line 1352 def fallback_locale_id=(val) self.fallback_locale_id = val end |
#file_format=(val) ⇒ Object
1356 1357 1358 |
# File 'lib/phraseapp-ruby.rb', line 1356 def file_format=(val) self.file_format = val end |
#format_options=(val) ⇒ Object
1360 1361 1362 |
# File 'lib/phraseapp-ruby.rb', line 1360 def (val) self. = JSON.load(val) end |
#include_empty_translations=(val) ⇒ Object
1364 1365 1366 1367 1368 1369 1370 1371 1372 |
# File 'lib/phraseapp-ruby.rb', line 1364 def include_empty_translations=(val) if val.is_a?(TrueClass) self.include_empty_translations = true elsif val.is_a?(FalseClass) #ignore self.include_empty_translations = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#keep_notranslate_tags=(val) ⇒ Object
1374 1375 1376 1377 1378 1379 1380 1381 1382 |
# File 'lib/phraseapp-ruby.rb', line 1374 def (val) if val.is_a?(TrueClass) self. = true elsif val.is_a?(FalseClass) #ignore self. = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#skip_unverified_translations=(val) ⇒ Object
1384 1385 1386 1387 1388 1389 1390 1391 1392 |
# File 'lib/phraseapp-ruby.rb', line 1384 def skip_unverified_translations=(val) if val.is_a?(TrueClass) self.skip_unverified_translations = true elsif val.is_a?(FalseClass) #ignore self.skip_unverified_translations = b else PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}") end end |
#tag=(val) ⇒ Object
1394 1395 1396 |
# File 'lib/phraseapp-ruby.rb', line 1394 def tag=(val) self.tag = val end |
#to_h ⇒ Object
1404 1405 1406 |
# File 'lib/phraseapp-ruby.rb', line 1404 def to_h @table.dup end |
#validate ⇒ Object
1398 1399 1400 1401 1402 |
# File 'lib/phraseapp-ruby.rb', line 1398 def validate if self.file_format == nil || self.file_format == "" raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"file_format\" of \"locale_downloadParams\" not set") end end |