lib/locale/info/language.rb in locale-2.0.5 vs lib/locale/info/language.rb in locale-2.0.6
- old
+ new
@@ -72,10 +72,14 @@
# Returns true if the language is a special type language according to the ISO 639-3 data.
def special_type?; @special_type; end
# Returns the two or three code.
def to_s
- two_code || tree_code
+ if two_code and two_code.size > 0
+ two_code
+ else
+ three_code
+ end
end
# Returns this object is valid as ISO 639 data.
def iso_language?
@@lang_two_codes[two_code] != nil || @@lang_three_codes[three_code] != nil