Fayland 林 > Locale-Country-Multilingual-0.06 > Locale::Country::Multilingual

Download:
Locale-Country-Multilingual-0.06.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.06   Source   Latest Release: Locale-Country-Multilingual-0.23

NAME ^

Locale::Country::Multilingual - ISO codes for country identification with multi-language (ISO 3166)

SYNOPSIS ^

    use Locale::Country::Multilingual;

    my $lcm = Locale::Country::Multilingual->new();
    $country = $lcm->code2country('jp');        # $country gets 'Japan'
    $country = $lcm->code2country('chn');       # $country gets 'China'
    $country = $lcm->code2country('250');       # $country gets 'France'
    $code    = $lcm->country2code('Norway');    # $code gets 'no'
    
    $lcm->set_lang('cn'); # set default language to Chinese
    $country = $lcm->code2country('cn');        # $country gets '中国'
    $code    = $lcm->country2code('日本');      # $code gets 'jp'
    
    @codes   = $lcm->all_country_codes();
    @names   = $lcm->all_country_names();
    
    # more heavy call
    my $lang = 'en';
    $country = $lcm->code2country('cn', $lang);        # $country gets 'China'
    $lang = 'cn';
    $country = $lcm->code2country('cn', $lang);        # $country gets '中国'
    
    my $CODE = 'LOCALE_CODE_ALPHA_2'; # by default
    $code    = $lcm->country2code('Norway', $CODE);    # $code gets 'no'
    $CODE = 'LOCALE_CODE_ALPHA_3';
    $code    = $lcm->country2code('Norway', $CODE);    # $code gets 'nor'
    $CODE = 'LOCALE_CODE_NUMERIC';
    $code    = $lcm->country2code('Norway', $CODE);    # $code gets '578'
    $code    = $lcm->country2code('挪威', $CODE, 'cn');    # with lang=cn
    
    $CODE = 'LOCALE_CODE_ALPHA_3';
    $lang = 'cn';
    @codes   = $lcm->all_country_codes($CODE);         # return codes with 3alpha
    @names   = $lcm->all_country_names($lang);         # get all Chinese Countries Names

AVAILABLE LANGAUGES ^

en - English
cn - Chinese Simp.
tw - Chinese Trad.
it - Italian
es - Spanish
pt - Portuguese
de - German
fr - French
ja - Japanese
no - Norwegian

other languages are welcome to send by email.

SEE ALSO ^

Locale::Country

ACKNOWLEDGEMENTS ^

Thanks to michele ongaro for Italian/Spanish/Portuguese/German/French/Japanese dat files.

Thanks to Andreas Marienborg for Norwegian dat file.

AUTHOR ^

Fayland Lam, <fayland at gmail.com>

COPYRIGHT & LICENSE ^

Copyright 2007-2008 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.