lib/spaceship/tunes/language_item.rb in spaceship-0.6.1 vs lib/spaceship/tunes/language_item.rb in spaceship-0.7.0
- old
+ new
@@ -4,10 +4,12 @@
class LanguageItem
attr_accessor :identifier # title or description
attr_accessor :original_array # reference to original array
def initialize(identifier, ref)
+ raise "ref is nil" if ref.nil?
+
self.identifier = identifier.to_s
self.original_array = ref
end
def [](key)
@@ -18,10 +20,10 @@
get_lang(key)[identifier]['value'] = value
end
def get_lang(lang)
result = self.original_array.find do |current|
- current['language'] == lang
+ current['language'] == lang or current['localeCode'] == lang # Apple being consistent
end
return result if result
raise "Language '#{lang}' is not activated for this app version."
end