| Previous | Next
I18N::LangTagsImplements language tags per RFC 3066. Language tags let you specify a certain language that you'll use in a segment of text or code. I18N::LangTags lets you perform a number of common tasks with language tasks that you might come across when dealing with different protocols and applications. I18N::LangTags is shipped with the Perl 5.8 source kit. It implements the following methods.
alternate_language_tags(language) Returns all language tags that are alternate forms of
encode_language_tag(language) Returns the encoding of a language tag. Returns
extract_language_tags(source) Returns a list of what is perceived as valid language tags from source. For example: my $chewbacca_dialect = 'growl, growl, fr, growl, growl!'; extract_language_tags($chewbacca_dialect); # Returns 'fr' Chewbacca is French?! Say it isn't so!
is_dialect_of(lang1, lang2) Returns true if lang1 represents a form of
is_language_tag(language) Returns true if language is a valid language tag. For example: my $gutteral = 'Chewbacca'; is_language_tag($gutteral); # false my $pourquois = 'fr'; is_language_tag($pourquois); # true
locale2language_tag(locale) Takes a locale name and maps it to a language tag. Certain tags aren't mappable, such as
same_language_tag(lang1, lang2) Returns true if lang1 and
similarity_language_tag(lang1, lang2) Returns an integer that represents the degree of similarity between
super_languages(language) Returns a list of language tags that are superordinate to
|