File: //scripts.20110531.215904.25158/get_locale_from_legacy_name_info
#!/usr/bin/perl
# cpanel - get_locale_from_legacy_name_info Copyright(c) 2010 cPanel, Inc.
# All rights Reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
BEGIN { unshift @INC, '/usr/local/cpanel'; }
use Cpanel::Locale::Utils::Legacy ();
if ( !@ARGV || grep /\-\-help/, @ARGV ) {
print <<"END_HELP";
$0 - lookup a locale code for one or more given legacy names
Example:
$0 fr French スペイン語 italiano spanish-utf8 中文 DANISH.lng Swedish.special "Heart cPanel"
Cpanel::Locale uses standard ISO language (and sometimes territory) codes to identify locales.
The codes are used by and have data defined in the CLDR (http://cldr.unicode.org/).
The legacy language system used arbitrary names for identification. In order to bring legacy data into Cpanel::Locale there needs to be a process to determine what locale a legacy name corresponds to.
This script is a utility that does the lookup and reports what locale it maps to.
Names that can not be mapped are turned in to 'i_' tag codes. An 'i_' tag is a standard way to create, identify, and work with a non-standard locale by prefixing the code with the letter 'i' followed by an underscore.
END_HELP
exit;
}
for my $arg (@ARGV) {
print "'$arg' maps to '" . Cpanel::Locale::Utils::Legacy::get_new_langtag_of_old_style_langname($arg) . "'\n";
}