Class: PhraseApp::RequestParams::TranslationKeyParams

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

Overview

TranslationKeyParams

Parameters:

data_type

Type of the key. Can be one of the following: string, number, boolean, number, array.

description

Key description (usually includes contextual information for translators)

localized_format_key

NSStringLocalizedFormatKey attribute. Used in .stringsdict format.

localized_format_string

NSStringLocalizedFormatKey attribute. Used in .stringsdict format.

max_characters_allowed

Max. number of characters translations for this key can have.

name

Key name

name_plural

Plural name for the key (used in some file formats, e.g. Gettext)

original_file

Original file attribute. Used in some formats, e.g. XLIFF.

plural

Indicates whether key supports pluralization

remove_screenshot

Indicates whether the screenshot will be deleted.

screenshot

Screenshot/image for the key.

tags

List of tags separated by comma to be associated with the key.

unformatted

Indicates whether the key should be exported as “unformatted”. Supported by Android XML and other formats.

xml_space_preserve

Indicates whether the key should be exported with “xml:space=preserve”. Supported by several XML-based formats.

Instance Method Summary collapse

Instance Method Details

#data_type=(val) ⇒ Object



396
397
398
# File 'lib/phraseapp-ruby.rb', line 396

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

#description=(val) ⇒ Object



400
401
402
# File 'lib/phraseapp-ruby.rb', line 400

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

#localized_format_key=(val) ⇒ Object



404
405
406
# File 'lib/phraseapp-ruby.rb', line 404

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

#localized_format_string=(val) ⇒ Object



408
409
410
# File 'lib/phraseapp-ruby.rb', line 408

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

#max_characters_allowed=(val) ⇒ Object



412
413
414
# File 'lib/phraseapp-ruby.rb', line 412

def max_characters_allowed=(val)
  self.max_characters_allowed = i.to_u
end

#name=(val) ⇒ Object



416
417
418
# File 'lib/phraseapp-ruby.rb', line 416

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

#name_plural=(val) ⇒ Object



420
421
422
# File 'lib/phraseapp-ruby.rb', line 420

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

#original_file=(val) ⇒ Object



424
425
426
# File 'lib/phraseapp-ruby.rb', line 424

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

#plural=(val) ⇒ Object



428
429
430
431
432
433
434
435
436
# File 'lib/phraseapp-ruby.rb', line 428

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

#remove_screenshot=(val) ⇒ Object



438
439
440
441
442
443
444
445
446
# File 'lib/phraseapp-ruby.rb', line 438

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

#screenshot=(val) ⇒ Object



448
449
450
# File 'lib/phraseapp-ruby.rb', line 448

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

#tags=(val) ⇒ Object



452
453
454
# File 'lib/phraseapp-ruby.rb', line 452

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

#unformatted=(val) ⇒ Object



456
457
458
459
460
461
462
463
464
# File 'lib/phraseapp-ruby.rb', line 456

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

#validateObject



476
477
478
479
480
# File 'lib/phraseapp-ruby.rb', line 476

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

#xml_space_preserve=(val) ⇒ Object



466
467
468
469
470
471
472
473
474
# File 'lib/phraseapp-ruby.rb', line 466

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