Class: PhraseApp::RequestParams::TranslationOrderParams

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

Overview

TranslationOrderParams

Parameters:

category

Category to use (required for orders processed by TextMaster). <a href=“#categories”>Category List</a>

include_untranslated_keys

Order translations for keys with untranslated content in the selected target locales.

include_unverified_translations

Order translations for keys with unverified content in the selected target locales.

lsp

Name of the LSP that should process this order. Can be one of gengo, textmaster.

message

Message that is displayed to the translators for description.

priority

Indicates whether the priority option should be ordered which decreases turnaround time by 30%. Available only for orders processed by TextMaster.

quality

Extra proofreading option to ensure consistency in vocabulary and style. Only available for orders processed by TextMaster.

source_locale_id

Source locale for the order. Can be the name or public id of the source locale. Preferred is the public id.

styleguide_id

Style guide for translators to be sent with the order.

tag

Tag you want to order translations for.

target_locale_ids

List of target locales you want the source content translate to. Can be the name or public id of the target locales. Preferred is the public id.

translation_type

Name of the quality level, availability depends on the LSP. Can be one of: standard, pro (for orders processed by Gengo) and one of regular, premium, enterprise (for orders processed by TextMaster)

unverify_translations_upon_delivery

Unverify translations upon delivery.

Instance Method Summary collapse

Instance Method Details

#category=(val) ⇒ Object



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

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

#include_untranslated_keys=(val) ⇒ Object



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

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

#include_unverified_translations=(val) ⇒ Object



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

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

#lsp=(val) ⇒ Object



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

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

#message=(val) ⇒ Object



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

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

#priority=(val) ⇒ Object



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

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

#quality=(val) ⇒ Object



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

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

#source_locale_id=(val) ⇒ Object



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

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

#styleguide_id=(val) ⇒ Object



667
668
669
# File 'lib/phraseapp-ruby.rb', line 667

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

#tag=(val) ⇒ Object



671
672
673
# File 'lib/phraseapp-ruby.rb', line 671

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

#target_locale_ids=(val) ⇒ Object



675
676
677
# File 'lib/phraseapp-ruby.rb', line 675

def target_locale_ids=(val)
  self.target_locale_ids = val.split(',')
end

#to_hObject



707
708
709
# File 'lib/phraseapp-ruby.rb', line 707

def to_h
  @table.dup
end

#translation_type=(val) ⇒ Object



679
680
681
# File 'lib/phraseapp-ruby.rb', line 679

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

#unverify_translations_upon_delivery=(val) ⇒ Object



683
684
685
686
687
688
689
690
691
# File 'lib/phraseapp-ruby.rb', line 683

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

#validateObject



693
694
695
696
697
698
699
700
701
702
703
704
705
# File 'lib/phraseapp-ruby.rb', line 693

def validate
  if self.category == nil || self.category == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"category\" of \"TranslationOrderParams\" not set")
  endif self.lsp == nil || self.lsp == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"lsp\" of \"TranslationOrderParams\" not set")
  endif self.source_locale_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"source_locale_id\" of \"TranslationOrderParams\" not set")
  endif self.target_locale_ids == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"target_locale_ids\" of \"TranslationOrderParams\" not set")
  endif self.translation_type == nil || self.translation_type == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"translation_type\" of \"TranslationOrderParams\" not set")
  end
end