class TripAdvisor::Translation
Attributes
id[RW]
key[RW]
localizations[RW]
note[RW]
Public Class Methods
locale_identifier_to_language_codes_mapping()
click to toggle source
Returns a dictionary that specifies how locale identifiers map to BCP 47 Language Identifiers
# File lib/trip_advisor/translation.rb, line 4 def self.locale_identifier_to_language_codes_mapping { "zh_TW" => "zh-Hant", "zh_CN"=> "zh-Hans", "zh_CN"=> "zh", "no"=> "nb", "in"=> "id", "en_UK"=> "en-GB" } end
new(attributes = {})
click to toggle source
# File lib/trip_advisor/translation.rb, line 46 def initialize(attributes = {}) @localizations = LocalizationsArray.new attributes.each { |k, v| self.send("#{k}=", v) } end
Public Instance Methods
[](locale_identifier)
click to toggle source
# File lib/trip_advisor/translation.rb, line 59 def [](locale_identifier) localizations[locale_identifier] end
key=(key)
click to toggle source
# File lib/trip_advisor/translation.rb, line 51 def key=(key) @key = key.strip end
localizations=(localizations)
click to toggle source
# File lib/trip_advisor/translation.rb, line 55 def localizations=(localizations) @localizations.concat(localizations) end