Development Page--Not for Official Use
PDB::LoadLang() - load language definitions
use PDB;
%lang = PDB::LoadLang('en_US');
This routine reads locale specific language files from $PDB::PDBROOT/lib/lang and returns the result as a hash. The file default.txt is always read first, then any locale specifications passed as arguments or in the HTTP_ACCEPT_LANGUAGE environment variable.
The canonical way to specify a locale is a two character language descriptor, underscore, then a two character country code. For example, the spanish spoken in Spain is denoted by es_ES and the spanish spoken in Mexico is es_MX ("es" for espanol (spanish) and "MX" for Mexico).
Sometimes the country code may not given and the locale is merely denoted by the two character language code (e.g., "es" rather than "es_MX"). To account for this, PDB::LoadLang() splits the locale specifier on underscores and dashes and tries to open the full locale file then, if that fails, just the prefix file.
These files are named LL_CC.txt where LL is the two character language code, and CC is the two character country code. Lines within these files are of the form:
text|translated text
where text is the english language word or phrase and translated text is that word or phrase in the appropriate language. Lines that start with a pound symbol (#) are comment lines and are ignored.
Since englsh language text is used as the "key" into the language translation table and it's some times advantageous to use a "shortcut" phrase for a long string of translated text, we need a place to store "shortcuts" for the english phrases. The default.txt file serves this purpose.
<< LevCheckImg | PerlModules | Log >>