Class: PhraseApp::RequestParams::LocaleDownloadParams

Inherits:
OpenStruct
  • Object
show all
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

Enforces a specific encoding on the file contents. Valid options are “UTF-8”, “UTF-16” and “ISO-8859-1”.

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

Instance Method Details

#convert_emoji=(val) ⇒ Object



1597
1598
1599
1600
1601
1602
1603
1604
1605
# File 'lib/phraseapp-ruby.rb', line 1597

def convert_emoji=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#encoding=(val) ⇒ Object



1607
1608
1609
# File 'lib/phraseapp-ruby.rb', line 1607

def encoding=(val)
  super(val)
end

#fallback_locale_id=(val) ⇒ Object



1611
1612
1613
# File 'lib/phraseapp-ruby.rb', line 1611

def fallback_locale_id=(val)
  super(val)
end

#file_format=(val) ⇒ Object



1615
1616
1617
# File 'lib/phraseapp-ruby.rb', line 1615

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1619
1620
1621
# File 'lib/phraseapp-ruby.rb', line 1619

def format_options=(val)
  super(JSON.load(val))
end

#include_empty_translations=(val) ⇒ Object



1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/phraseapp-ruby.rb', line 1623

def include_empty_translations=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#keep_notranslate_tags=(val) ⇒ Object



1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'lib/phraseapp-ruby.rb', line 1633

def keep_notranslate_tags=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#skip_unverified_translations=(val) ⇒ Object



1643
1644
1645
1646
1647
1648
1649
1650
1651
# File 'lib/phraseapp-ruby.rb', line 1643

def skip_unverified_translations=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#tag=(val) ⇒ Object



1653
1654
1655
# File 'lib/phraseapp-ruby.rb', line 1653

def tag=(val)
  super(val)
end

#validateObject



1657
1658
1659
1660
1661
1662
# File 'lib/phraseapp-ruby.rb', line 1657

def validate
  
  if file_format == nil || file_format == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"file_format\" of \"locale_downloadParams\" not set")
  end
end