=begin locale/object.rb - Locale::Object Copyright (C) 2006,2007 Masao Mutoh You may redistribute it and/or modify it under the same license terms as Ruby. $Id: object.rb,v 1.3 2008/01/27 10:58:10 mutoh Exp $ =end module Locale class Object attr_reader :language, :country, :charset, :script, :variant, :modifier, :orig_str # Set the language. e.g.) ja, en, fr, ... def language=(val) @language = val clear end # Set the country. e.g.) JP, US, FR, ... def country=(val) @country = val clear end # Set the charset. e.g.) UTF-8, EUC-JP, Shift_JIS def charset=(val) @charset = val clear end # Set the script. e.g.) Latn def script=(val) @script = val clear end # Set the variant. e.g.) Hant def variant=(val) @variant = val clear end # Set the modifier. e.g.) curreny=DDM def modifier=(val) @modifier = val clear end # A fallback locale. With GetText, you don't need to set English(en,C,POSIX) # by yourself because English is used as the last fallback locale anytime. attr_accessor :fallback # Parse POSIX or RFC 3066 style locale name to Array. # # * locale_name: locale name as String # # * Basic POSIX format: _.@ # * Both of POSIX and C are converted to "en". # * Basic RFC3066 format: - # * Win32 format: --