LanguageTaggish

Raison dโ€™รชtre

While there are not many language tag standards, there at least three in common use. This role aims to define some common features to aid their interaction.

The core attributes (defined as methods in the role) are language and region. These will normally return values in ISO 639 (language) or ISO 3166/UN M.49 (region) formats, but they are not obligated to.

A bcp47 method should provide conversion into a BCP-47-compliant string. For example, Apple allows "English" or "Spanish" as valid identifiers for its .lproj identifiers. So a theoretical AppleLProj class that does LanguageTaggish would output English for .language, but for bcp47, would output en. If a conversion is not possible, a falsey value should be returned (for example, `self.Str but False`).

It is expected that classes implementing LanguageTaggish will add additional methods and attributes. In keeping with tradition established by other language tag frameworks (in particular ICU), requested values not present should return the empty string. The role handles this by default via its FALLBACK method. For this reason, new language tag classes are strongly urged to adopt standard accessor names in line with extant classes.

Intl::LanguageTaggish v0.1

A role modeling behaviors of a Language Tag

Authors

  • Matthew Stephen Stuckwisch

License

Artist-2.0

Dependencies

Test Dependencies

Provides

  • Intl::LanguageTaggish

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.