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



582
583
584
# File 'lib/phraseapp-ruby.rb', line 582

def data_type=(val)
  super(val)
end

#description=(val) ⇒ Object



586
587
588
# File 'lib/phraseapp-ruby.rb', line 586

def description=(val)
  super(val)
end

#localized_format_key=(val) ⇒ Object



590
591
592
# File 'lib/phraseapp-ruby.rb', line 590

def localized_format_key=(val)
  super(val)
end

#localized_format_string=(val) ⇒ Object



594
595
596
# File 'lib/phraseapp-ruby.rb', line 594

def localized_format_string=(val)
  super(val)
end

#max_characters_allowed=(val) ⇒ Object



598
599
600
# File 'lib/phraseapp-ruby.rb', line 598

def max_characters_allowed=(val)
  super(val.to_i)
end

#name=(val) ⇒ Object



602
603
604
# File 'lib/phraseapp-ruby.rb', line 602

def name=(val)
  super(val)
end

#name_plural=(val) ⇒ Object



606
607
608
# File 'lib/phraseapp-ruby.rb', line 606

def name_plural=(val)
  super(val)
end

#original_file=(val) ⇒ Object



610
611
612
# File 'lib/phraseapp-ruby.rb', line 610

def original_file=(val)
  super(val)
end

#plural=(val) ⇒ Object



614
615
616
617
618
619
620
621
622
# File 'lib/phraseapp-ruby.rb', line 614

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

#remove_screenshot=(val) ⇒ Object



624
625
626
627
628
629
630
631
632
# File 'lib/phraseapp-ruby.rb', line 624

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

#screenshot=(val) ⇒ Object



634
635
636
# File 'lib/phraseapp-ruby.rb', line 634

def screenshot=(val)
  super(val)
end

#tags=(val) ⇒ Object



638
639
640
# File 'lib/phraseapp-ruby.rb', line 638

def tags=(val)
  super(val)
end

#unformatted=(val) ⇒ Object



642
643
644
645
646
647
648
649
650
# File 'lib/phraseapp-ruby.rb', line 642

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

#validateObject



662
663
664
665
666
667
# File 'lib/phraseapp-ruby.rb', line 662

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

#xml_space_preserve=(val) ⇒ Object



652
653
654
655
656
657
658
659
660
# File 'lib/phraseapp-ruby.rb', line 652

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