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

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.

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



1198
1199
1200
1201
1202
1203
1204
1205
1206
# File 'lib/phraseapp-ruby.rb', line 1198

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



1208
1209
1210
# File 'lib/phraseapp-ruby.rb', line 1208

def encoding=(val)
  self.encoding = val
end

#file_format=(val) ⇒ Object



1212
1213
1214
# File 'lib/phraseapp-ruby.rb', line 1212

def file_format=(val)
  self.file_format = val
end

#format_options=(val) ⇒ Object



1216
1217
1218
# File 'lib/phraseapp-ruby.rb', line 1216

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

#include_empty_translations=(val) ⇒ Object



1220
1221
1222
1223
1224
1225
1226
1227
1228
# File 'lib/phraseapp-ruby.rb', line 1220

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



1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/phraseapp-ruby.rb', line 1230

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

#skip_unverified_translations=(val) ⇒ Object



1240
1241
1242
1243
1244
1245
1246
1247
1248
# File 'lib/phraseapp-ruby.rb', line 1240

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



1250
1251
1252
# File 'lib/phraseapp-ruby.rb', line 1250

def tag=(val)
  self.tag = val
end

#validateObject



1254
1255
1256
1257
1258
# File 'lib/phraseapp-ruby.rb', line 1254

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