Commit | Line | Data |
---|---|---|
f768f60b | 1 | =pod |
6b14ceb7 JH |
2 | |
3 | =head1 NAME | |
4 | ||
f768f60b | 5 | Locale::Language - standard codes for language identification |
6b14ceb7 JH |
6 | |
7 | =head1 SYNOPSIS | |
8 | ||
f768f60b | 9 | use Locale::Language; |
6b14ceb7 | 10 | |
f768f60b S |
11 | $lang = code2language('en'); # $lang gets 'English' |
12 | $code = language2code('French'); # $code gets 'fr' | |
13 | ||
14 | @codes = all_language_codes(); | |
15 | @names = all_language_names(); | |
6b14ceb7 JH |
16 | |
17 | =head1 DESCRIPTION | |
18 | ||
68bfa5ea | 19 | This module provides access to standard codes used |
f768f60b | 20 | for identifying languages, such as those as defined in ISO 639. |
6b14ceb7 | 21 | |
f768f60b S |
22 | Most of the routines take an optional additional argument which |
23 | specifies the code set to use. If not specified, the default ISO | |
24 | 639 two-letter codes will be used. | |
6b14ceb7 | 25 | |
f768f60b | 26 | =head1 SUPPORTED CODE SETS |
6b14ceb7 | 27 | |
f768f60b | 28 | There are several different code sets you can use for identifying |
4345d05b CBW |
29 | languages. A code set may be specified using either a name, or a |
30 | constant that is automatically exported by this module. | |
31 | ||
32 | For example, the two are equivalent: | |
33 | ||
34 | $lang = code2language('en','alpha-2'); | |
e64a1908 | 35 | $lang = code2language('en',LOCALE_LANG_ALPHA_2); |
4345d05b CBW |
36 | |
37 | The codesets currently supported are: | |
6b14ceb7 JH |
38 | |
39 | =over 4 | |
40 | ||
4345d05b | 41 | =item B<alpha-2, LOCALE_LANG_ALPHA_2> |
6b14ceb7 | 42 | |
c69a30ec CBW |
43 | This is the set of two-letter (lowercase) codes from ISO 639-1, such |
44 | as 'he' for Hebrew. It also includes additions to this set included | |
45 | in the IANA language registry. | |
6b14ceb7 | 46 | |
f768f60b | 47 | This is the default code set. |
6b14ceb7 | 48 | |
4345d05b | 49 | =item B<alpha-3, LOCALE_LANG_ALPHA_3> |
6b14ceb7 | 50 | |
f768f60b | 51 | This is the set of three-letter (lowercase) bibliographic codes from |
c69a30ec CBW |
52 | ISO 639-2 and 639-5, such as 'heb' for Hebrew. It also includes |
53 | additions to this set included in the IANA language registry. | |
6b14ceb7 | 54 | |
4345d05b | 55 | =item B<term, LOCALE_LANG_TERM> |
6b14ceb7 | 56 | |
f768f60b S |
57 | This is the set of three-letter (lowercase) terminologic codes from |
58 | ISO 639. | |
6b14ceb7 | 59 | |
f768f60b S |
60 | =back |
61 | ||
62 | =head1 ROUTINES | |
6b14ceb7 JH |
63 | |
64 | =over 4 | |
65 | ||
68bfa5ea | 66 | =item B<code2language(CODE [,CODESET] [,'retired'])> |
6b14ceb7 | 67 | |
68bfa5ea | 68 | =item B<language2code(NAME [,CODESET] [,'retired'])> |
6b14ceb7 | 69 | |
68bfa5ea | 70 | =item B<language_code2code(CODE ,CODESET ,CODESET2)> |
6b14ceb7 | 71 | |
68bfa5ea | 72 | =item B<all_language_codes([CODESET] [,'retired'])> |
6b14ceb7 | 73 | |
68bfa5ea | 74 | =item B<all_language_names([CODESET] [,'retired'])> |
6b14ceb7 | 75 | |
68bfa5ea | 76 | =item B<Locale::Language::rename_language(CODE ,NEW_NAME [,CODESET])> |
6b14ceb7 | 77 | |
68bfa5ea | 78 | =item B<Locale::Language::add_language(CODE ,NAME [,CODESET])> |
6b14ceb7 | 79 | |
68bfa5ea | 80 | =item B<Locale::Language::delete_language(CODE [,CODESET])> |
6b14ceb7 | 81 | |
68bfa5ea | 82 | =item B<Locale::Language::add_language_alias(NAME ,NEW_NAME)> |
6b14ceb7 | 83 | |
68bfa5ea | 84 | =item B<Locale::Language::delete_language_alias(NAME)> |
6b14ceb7 | 85 | |
68bfa5ea | 86 | =item B<Locale::Language::rename_language_code(CODE ,NEW_CODE [,CODESET])> |
6b14ceb7 | 87 | |
68bfa5ea | 88 | =item B<Locale::Language::add_language_code_alias(CODE ,NEW_CODE [,CODESET])> |
6b14ceb7 | 89 | |
68bfa5ea | 90 | =item B<Locale::Language::delete_language_code_alias(CODE [,CODESET])> |
6b14ceb7 | 91 | |
68bfa5ea | 92 | These routines are all documented in the L<Locale::Codes::API> man page. |
6b14ceb7 JH |
93 | |
94 | =back | |
95 | ||
96 | =head1 SEE ALSO | |
97 | ||
98 | =over 4 | |
99 | ||
68bfa5ea | 100 | =item L<Locale::Codes> |
6b14ceb7 | 101 | |
c69a30ec CBW |
102 | The Locale-Codes distribution. |
103 | ||
68bfa5ea | 104 | =item L<Locale::Codes::API> |
c69a30ec CBW |
105 | |
106 | The list of functions supported by this module. | |
6b14ceb7 | 107 | |
68bfa5ea | 108 | =item L<http://www.loc.gov/standards/iso639-2/> |
6b14ceb7 | 109 | |
c69a30ec CBW |
110 | Source of the ISO 639-2 codes. |
111 | ||
68bfa5ea | 112 | =item L<http://www.loc.gov/standards/iso639-5/> |
c69a30ec CBW |
113 | |
114 | Source of the ISO 639-5 codes. | |
115 | ||
68bfa5ea | 116 | =item L<http://www.iana.org/assignments/language-subtag-registry> |
c69a30ec CBW |
117 | |
118 | The IANA language subtag registry. | |
6b14ceb7 JH |
119 | |
120 | =back | |
121 | ||
6b14ceb7 JH |
122 | =head1 AUTHOR |
123 | ||
f768f60b | 124 | See Locale::Codes for full author history. |
6b14ceb7 | 125 | |
f768f60b | 126 | Currently maintained by Sullivan Beck (sbeck@cpan.org). |
6b14ceb7 | 127 | |
f768f60b | 128 | =head1 COPYRIGHT |
6b14ceb7 | 129 | |
f768f60b S |
130 | Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). |
131 | Copyright (c) 2001-2010 Neil Bowers | |
2107eff2 | 132 | Copyright (c) 2010-2015 Sullivan Beck |
6b14ceb7 JH |
133 | |
134 | This module is free software; you can redistribute it and/or | |
135 | modify it under the same terms as Perl itself. | |
136 | ||
137 | =cut |