Class: PhraseApp::RequestParams::TranslationKeyParams
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- PhraseApp::RequestParams::TranslationKeyParams
- 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
- #data_type=(val) ⇒ Object
- #description=(val) ⇒ Object
- #localized_format_key=(val) ⇒ Object
- #localized_format_string=(val) ⇒ Object
- #max_characters_allowed=(val) ⇒ Object
- #name=(val) ⇒ Object
- #name_plural=(val) ⇒ Object
- #original_file=(val) ⇒ Object
- #plural=(val) ⇒ Object
- #remove_screenshot=(val) ⇒ Object
- #screenshot=(val) ⇒ Object
- #tags=(val) ⇒ Object
- #to_h ⇒ Object
- #unformatted=(val) ⇒ Object
- #validate ⇒ Object
- #xml_space_preserve=(val) ⇒ Object
Instance Method Details
#data_type=(val) ⇒ Object
413 414 415 |
# File 'lib/phraseapp-ruby.rb', line 413 def data_type=(val) self.data_type = val end |
#description=(val) ⇒ Object
417 418 419 |
# File 'lib/phraseapp-ruby.rb', line 417 def description=(val) self.description = val end |
#localized_format_key=(val) ⇒ Object
421 422 423 |
# File 'lib/phraseapp-ruby.rb', line 421 def localized_format_key=(val) self.localized_format_key = val end |
#localized_format_string=(val) ⇒ Object
425 426 427 |
# File 'lib/phraseapp-ruby.rb', line 425 def localized_format_string=(val) self.localized_format_string = val end |
#max_characters_allowed=(val) ⇒ Object
429 430 431 |
# File 'lib/phraseapp-ruby.rb', line 429 def max_characters_allowed=(val) self.max_characters_allowed = i.to_u end |
#name=(val) ⇒ Object
433 434 435 |
# File 'lib/phraseapp-ruby.rb', line 433 def name=(val) self.name = val end |
#name_plural=(val) ⇒ Object
437 438 439 |
# File 'lib/phraseapp-ruby.rb', line 437 def name_plural=(val) self.name_plural = val end |
#original_file=(val) ⇒ Object
441 442 443 |
# File 'lib/phraseapp-ruby.rb', line 441 def original_file=(val) self.original_file = val end |
#plural=(val) ⇒ Object
445 446 447 448 449 450 451 452 453 |
# File 'lib/phraseapp-ruby.rb', line 445 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
455 456 457 458 459 460 461 462 463 |
# File 'lib/phraseapp-ruby.rb', line 455 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
465 466 467 |
# File 'lib/phraseapp-ruby.rb', line 465 def screenshot=(val) self.screenshot = val end |
#tags=(val) ⇒ Object
469 470 471 |
# File 'lib/phraseapp-ruby.rb', line 469 def (val) self. = val end |
#to_h ⇒ Object
499 500 501 |
# File 'lib/phraseapp-ruby.rb', line 499 def to_h @table.dup end |
#unformatted=(val) ⇒ Object
473 474 475 476 477 478 479 480 481 |
# File 'lib/phraseapp-ruby.rb', line 473 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 |
#validate ⇒ Object
493 494 495 496 497 |
# File 'lib/phraseapp-ruby.rb', line 493 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
483 484 485 486 487 488 489 490 491 |
# File 'lib/phraseapp-ruby.rb', line 483 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 |