™.. Locale::Language - Online Linux Manual PageSection : 3pm
Updated : 2009-02-12
Source : perl v5.10.1
Note : Perl Programmers Reference Guide

NAMELocale::Language − ISO two letter codes for language identification (ISO 639)

SYNOPSIS​ use Locale::Language; ​ ​ $lang = code2language('en'); # $lang gets 'English' ​ $code = language2code('French'); # $code gets 'fr' ​ ​ @codes = all_language_codes(); ​ @names = all_language_names();

DESCRIPTIONThe \*(C`Locale::Language\*(C'\fR module provides access to the \s-1ISO\s0 two-letter codes for identifying languages, as defined in ISO 639. You can either access the codes via the conversion routines (described below), or via the two functions which return lists of all language codes or all language names.

CONVERSION ROUTINESThere are two conversion routines: \*(C`code2language()\*(C'\fR and \f(CW\*(C`language2code()\*(C'\fR. code2language() This function takes a two letter language code and returns a string which contains the name of the language identified. If the code is not a valid language code, as defined by ISO 639, then \*(C`undef\*(C'\fR will be returned. ​ $lang = code2language($code); language2code() This function takes a language name and returns the corresponding two letter language code, if such exists. If the argument could not be identified as a language name, then \*(C`undef\*(C'\fR will be returned. ​ $code = language2code('French'); The case of the language name is not important. See the section KNOWN BUGS AND LIMITATIONS below.

QUERY ROUTINESThere are two function which can be used to obtain a list of all language codes, or all language names: all_language_codes() Returns a list of all two-letter language codes. The codes are guaranteed to be all lower-case, and not in any particular order. all_language_names() Returns a list of all language names for which there is a corresponding two-letter language code. The names are capitalised, and not returned in any particular order.

EXAMPLESThe following example illustrates use of the \*(C`code2language()\*(C'\fR function. The user is prompted for a language code, and then told the corresponding language name: ​ $| = 1; # turn off buffering ​ ​ print "Enter language code: "; ​ chop($code = <STDIN>); ​ $lang = code2language($code); ​ if (defined $lang){ ​ print "$code = $lang\n"; ​ } ​ else ​ { ​ print "'$code' is not a valid language code!\n"; ​ }

KNOWN BUGS AND LIMITATIONS• In the current implementation, all data is read in when the module is loaded, and then held in memory. A lazy implementation would be more memory friendly. • Currently just supports the two letter language codes − there are also three-letter codes, and numbers. Would these be of any use to anyone?

SEE ALSOLocale::Country ISO codes for identification of country (ISO 3166). Supports 2−letter, 3−letter, and numeric country codes. Locale::Script ISO codes for identification of written scripts (ISO 15924). Locale::Currency ISO three letter codes for identification of currencies and funds (ISO 4217). ISO 639:1988 (E/F) Code for the representation of names of languages. http://lcweb.loc.gov/standards/iso639−2/langhome.html Home page for ISO 639−2.

AUTHORNeil Bowers <neil@bowers.com>

COPYRIGHTCopyright (C) 2002−2004, Neil Bowers. Copyright (c) 1997−2001 Canon Research Centre Europe (CRE). This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
0
Johanes Gumabo
Data Size   :   13,324 byte
man-Locale::Language.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 177,691
Visitor ID   :     :  
Visitor IP   :   3.148.115.43   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Locale::Language.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Locale::Language.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Locale::Language.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|Locale::Language.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|Locale::Language.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|Locale::Language.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|Locale::Language.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|Locale::Language.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|Locale::Language.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|Locale::Language.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|Locale::Language.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|Locale::Language.3pm|147|\*(C`Locale::Language\*(C'\fR module provides access to the \s-1ISO\s0 two-letter |The \f(CW\*(C`Locale::Language\*(C'\fR module provides access to the \s-1ISO\s0 two-letter )         (rof_escape_sequence|91|Locale::Language.3pm|154|\*(C`code2language()\*(C'\fR and \f(CW\*(C`language2code()\*(C'\fR. |There are two conversion routines: \f(CW\*(C`code2language()\*(C'\fR and \f(CW\*(C`language2code()\*(C'\fR. )         (rof_escape_sequence|91|Locale::Language.3pm|159|\*(C`undef\*(C'\fR |not a valid language code, as defined by \s-1ISO\s0 639, then \f(CW\*(C`undef\*(C'\fR )         (rof_escape_sequence|91|Locale::Language.3pm|170|\*(C`undef\*(C'\fR will be returned. |then \f(CW\*(C`undef\*(C'\fR will be returned. )         (rof_escape_sequence|91|Locale::Language.3pm|196|\*(C`code2language()\*(C'\fR function. |The following example illustrates use of the \f(CW\*(C`code2language()\*(C'\fR function. )