ISO::3611
From Cyclone3 Wiki
Tool for working with world country names, including their 3 and 2-character representation and localized name.
The toolbox works with text files located in TOM/.core/.libs/ISO/3611.
a3.txt contains standardized list of countries with their 2 and 3-character representation. lng.txt (where lng is system 2-character code, ie. en) contains translations of standardized names into localized names. To be able to use a new translation, you need to create this file with translated names.
Contents |
lng_load(lng)
Initializes the ISO toolbox for future calls. The function takes a single parameter - 2-character language code. Can be used multiple times to load multiple translations, in case you currently need more than one.
Syntax:
ISO::3611::lng_load('sk'); # loads Slovak language country name translations
code_a2{lng}
Returns a hash reference of 2-character name keys with their standardized name values
Syntax:
$ISO::3611::code_a2{'ZA'} # returns SOUTH AFRICA
code_a3{lng}
Returns a hash reference of 3-character name keys with their standardized name values
Syntax:
$ISO::3611::code_a3{'ZAR'} # returns SOUTH AFRICA
code_rev{lng}
Returns a hash reference of standardized name keys with subhash of 2 and 3-character representation
Syntax:
$ISO::3611::code_rev{'SOUTH AFRICA'}{'a2'} # returns ZA $ISO::3611::code_rev{'SOUTH AFRICA'}{'a3'} # returns ZAR
code_lng{lng}
Returns a hash reference of standardized name keys with their localized values
Syntax:
$ISO::3611::code_lng{'sk'}{'SOUTH AFRICA'} # returns Južná Afrika
code_lng_rev{lng}
Returns a hash reference of localized name keys and its standardized values
Syntax:
$ISO::3611::code_lng_rev{'sk'}{'Južná Afrika'} # returns SOUTH AFRICA
Categories: ISO | TOM::3611 | Libs