Returns an unsorted list of country names in the current or given locale. all_country_names = $lcm->all_country_names('fr') The argument is optional and can be one of "LOCALE_CODE_ALPHA_2", "LOCALE_CODE_ALPHA_3" and "LOCALE_CODE_NUMERIC". Returns an unsorted list of all ISO-3166 codes. all_country_codes = $lcm->all_country_codes($codeset)
This method croaks if the language is not available.
#Iso country codes code#
Returns an ISO-3166 code or undef if search fails. The third argument is the language to use for the country name and is optional too. The second argument is optional and can be one of "LOCALE_CODE_ALPHA_2", "LOCALE_CODE_ALPHA_3" and "LOCALE_CODE_NUMERIC". Aside from being case-insensitive the country must be written exactly the way how "code2country" returns it. Take a country name and return the two-letter code when available. 'République tchèque', 'LOCALE_CODE_ALPHA_2', 'fr' The default language is "en".Īccepts either two-letter or a three-letter code or a 3 digit numerical code.Ī language might be given as second argument to set the output language only for this call - it does not change the current language, that was set with "set_lang".
#Iso country codes iso#
Turns an ISO 3166-1 code into a country name in the current language. $country = $lcm->code2country('GB', 'zh') Or die "unable to load any language\n" code2country $country = $lcm->code2country('GB') Actually loads the language data, but does not set the language, so you probably want to use it this way: $lang = $lcm->assert_lang(qw/es it fr en/) Returns undef if none of the given languages could be loaded.
Returns the language code for the first language that was successfully loaded. Tries to load any of the given languages. assert_lang $lang = $lcm->assert_lang('es', 'it', 'fr') Use "assert_lang" if you really need to know for sure if a language is supported. This method does not actually load the language data. See "AVAILABLE LANGAUGES" for what codes are accepted. Only argument is a language code as described in the "DESCRIPTION" above. See Locale::Country::Multilingual::Unicode for more information. Set this true if you need correct encoding behavior. Accepts optional list of named arguments: lang
$lcm = Locale::Country::Multilingual->new(Ĭonstructor method. new $lcm = Locale::Country::Multilingual->new The only option ATM is use_io_layer and works for Perl 5.8 and higher. The last argument can be a reference to a hash of options. in an Apache mod_perl environment - language data that is loaded before forking is shared by all processes and thus saving memory. This can be useful when several processes are forked from the main application, e.g. Language files can be pre-loaded at compile time, by specifying their language codes. The import class method is called when a module is use'd. Version 0.25 SYNOPSIS use Locale::Country::Multilingual Locale::Country::Multilingual - Map ISO codes to localized country names VERSION