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



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

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

#description=(val) ⇒ Object



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

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

#localized_format_key=(val) ⇒ Object



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

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

#localized_format_string=(val) ⇒ Object



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

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

#max_characters_allowed=(val) ⇒ Object



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

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

#name=(val) ⇒ Object



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

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

#name_plural=(val) ⇒ Object



428
429
430
# File 'lib/phraseapp-ruby.rb', line 428

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

#original_file=(val) ⇒ Object



432
433
434
# File 'lib/phraseapp-ruby.rb', line 432

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

#plural=(val) ⇒ Object



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

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



446
447
448
449
450
451
452
453
454
# File 'lib/phraseapp-ruby.rb', line 446

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



456
457
458
# File 'lib/phraseapp-ruby.rb', line 456

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

#tags=(val) ⇒ Object



460
461
462
# File 'lib/phraseapp-ruby.rb', line 460

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

#unformatted=(val) ⇒ Object



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

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



484
485
486
487
488
# File 'lib/phraseapp-ruby.rb', line 484

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



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

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