Class: PhraseApp::RequestParams::LocaleDownloadParams

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/phraseapp-ruby.rb

Overview

LocaleDownloadParams

Parameters:

branch

specify the branch to use

convert_emoji

Indicates whether Emoji symbols should be converted to actual Emojis. <a href=“phraseapp.com/docs/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=“phraseapp.com/docs/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

#branch=(val) ⇒ Object



1994
1995
1996
# File 'lib/phraseapp-ruby.rb', line 1994

def branch=(val)
  super(val)
end

#convert_emoji=(val) ⇒ Object



1998
1999
2000
2001
2002
2003
2004
2005
2006
# File 'lib/phraseapp-ruby.rb', line 1998

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



2008
2009
2010
# File 'lib/phraseapp-ruby.rb', line 2008

def encoding=(val)
  super(val)
end

#fallback_locale_id=(val) ⇒ Object



2012
2013
2014
# File 'lib/phraseapp-ruby.rb', line 2012

def fallback_locale_id=(val)
  super(val)
end

#file_format=(val) ⇒ Object



2016
2017
2018
# File 'lib/phraseapp-ruby.rb', line 2016

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



2020
2021
2022
# File 'lib/phraseapp-ruby.rb', line 2020

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

#include_empty_translations=(val) ⇒ Object



2024
2025
2026
2027
2028
2029
2030
2031
2032
# File 'lib/phraseapp-ruby.rb', line 2024

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



2034
2035
2036
2037
2038
2039
2040
2041
2042
# File 'lib/phraseapp-ruby.rb', line 2034

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



2044
2045
2046
2047
2048
2049
2050
2051
2052
# File 'lib/phraseapp-ruby.rb', line 2044

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



2054
2055
2056
# File 'lib/phraseapp-ruby.rb', line 2054

def tag=(val)
  super(val)
end

#validateObject



2058
2059
2060
2061
2062
2063
# File 'lib/phraseapp-ruby.rb', line 2058

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