about modules for country name in native language.

about modules for country name in native language.

am 05.04.2006 12:09:10 von unknown

I need a functionality.
"get a country name in its official language, it could be more than one
official language"

for exmaple:
# Switzerland has 4 official language: German, French, Italian, Romansh
get_native_name("ch") will get "Schweiz", "Suisse", "Svizzera" and
"Svizra"

I didn't find a similar module in CPAN.
if it seems useful, I coulld contribute to CPAN.

Re: about modules for country name in native language.

am 18.04.2006 14:02:53 von lars

easy wrote:
: "get a country name in its official language, it could be more than one
: official language"

That would be useful. You might have it several options for what kind of
values the function returns. ISO 3166 gives country names in both English
and French:
http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-316 6-code-lists/iso_3166-1_decoding_table.html

So maybe the basic function can return the English name,

use ISO_3166_to_text qw(official_name);
print &country("ch");

e.g. the above would print 'Switzerland' :

unless the default is specified as being French instead

use ISO_3166_to_text qw(official_name);
$String::ISO_3166_to_text::default="fr";
print &official_name("ch");

e.g. the above would print "Suisse"

: # Switzerland has 4 official language: German, French, Italian, Romansh
: get_native_name("ch") will get "Schweiz", "Suisse", "Svizzera" and
: "Svizra"

Then a call to the same function with additional parameters, or a
different function, would return a hash using the ISO 639 language codes
as the keys for the official names. e.g. :

(
'en' => "Switzerland", # part of ISO 3166
'fr' => "Suisse", # part of ISO 3166
'de' => "Schweiz",
'it' => "Svizzera",
'rom' => "Svizra" # did I guess right?
);

'en' and 'fr' would be present for all countries. The presence of other
languages would be then determined by the official names. The return
values ought to be in UTF-8 to accomodate names in non-ASCII.

One question would be whether to use only the official names that the
particular countries official languages use or to include others. I'd lean
towards the former, since the latter could conceivably complicate matters
too much.

-Lars

--
Lars
Software patents harm all Net-based business, write your MEP:
http://wwwdb.europarl.eu.int/ep6/owa/p_meps2.repartition?ilg =EN

Re: about modules for country name in native language.

am 27.04.2006 19:25:05 von jwkenne

lars@nospam.nosoftwarepatents.edu wrote:
> easy wrote:
> : "get a country name in its official language, it could be more than one
> : official language"
>
> That would be useful. You might have it several options for what kind of
> values the function returns. ISO 3166 gives country names in both English
> and French:
> http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-316 6-code-lists/iso_3166-1_decoding_table.html
>
> So maybe the basic function can return the English name,
>
> use ISO_3166_to_text qw(official_name);
> print &country("ch");
>
> e.g. the above would print 'Switzerland' :
>
> unless the default is specified as being French instead
>
> use ISO_3166_to_text qw(official_name);
> $String::ISO_3166_to_text::default="fr";
> print &official_name("ch");
>
> e.g. the above would print "Suisse"
>
> : # Switzerland has 4 official language: German, French, Italian, Romansh
> : get_native_name("ch") will get "Schweiz", "Suisse", "Svizzera" and
> : "Svizra"
>
> Then a call to the same function with additional parameters, or a
> different function, would return a hash using the ISO 639 language codes
> as the keys for the official names. e.g. :
>
> (
> 'en' => "Switzerland", # part of ISO 3166
> 'fr' => "Suisse", # part of ISO 3166
> 'de' => "Schweiz",
> 'it' => "Svizzera",
> 'rom' => "Svizra" # did I guess right?
> );
>
> 'en' and 'fr' would be present for all countries. The presence of other
> languages would be then determined by the official names. The return
> values ought to be in UTF-8 to accomodate names in non-ASCII.
>
> One question would be whether to use only the official names that the
> particular countries official languages use or to include others. I'd lean
> towards the former, since the latter could conceivably complicate matters
> too much.

Actually, for some purposes, the official name of Switzerland is Latin
"Helvetia" (being neither French, German, Italian, nor Romansh, it's
politically neutral).

--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"