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



1610
1611
1612
1613
1614
1615
1616
1617
1618
# File 'lib/phraseapp-ruby.rb', line 1610

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



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

def encoding=(val)
  super(val)
end

#fallback_locale_id=(val) ⇒ Object



1624
1625
1626
# File 'lib/phraseapp-ruby.rb', line 1624

def fallback_locale_id=(val)
  super(val)
end

#file_format=(val) ⇒ Object



1628
1629
1630
# File 'lib/phraseapp-ruby.rb', line 1628

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1632
1633
1634
# File 'lib/phraseapp-ruby.rb', line 1632

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

#include_empty_translations=(val) ⇒ Object



1636
1637
1638
1639
1640
1641
1642
1643
1644
# File 'lib/phraseapp-ruby.rb', line 1636

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



1646
1647
1648
1649
1650
1651
1652
1653
1654
# File 'lib/phraseapp-ruby.rb', line 1646

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



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

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



1666
1667
1668
# File 'lib/phraseapp-ruby.rb', line 1666

def tag=(val)
  super(val)
end

#validateObject



1670
1671
1672
1673
1674
1675
# File 'lib/phraseapp-ruby.rb', line 1670

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