package
0.0.0-20201102054017-282493799a89
Repository: https://github.com/golangltd/leafltd.git
Documentation: pkg.go.dev

# Packages

Package display provides display names for languages, scripts and regions in a requested language.

# Functions

CompactIndex returns an index, where 0 <= index < NumCompactTags, for tags for which data exists in the text repository.
Compose creates a Tag from individual parts, which may be of type Tag, Base, Script, Region, Variant, []Variant, Extension, []Extension or error.
Comprehends reports the confidence score for a speaker of a given language to being able to comprehend the written form of an alternative language.
EncodeM49 returns the Region for the given UN M.49 code.
Make is a convenience wrapper for Parse that omits the error.
MatchStrings parses and matches the given strings until one of them matches the language in the Matcher.
MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
MustParseRegion is like ParseRegion, but panics if the given region cannot be parsed.
MustParseScript is like ParseScript, but panics if the given script cannot be parsed.
NewCoverage returns a Coverage for the given lists.
NewMatcher returns a Matcher that matches an ordered list of preferred tags against a list of supported tags based on written intelligibility, closeness of dialect, equivalence of subtags and various other rules.
Parse parses the given BCP 47 string and returns a valid Tag.
ParseAcceptLanguage parses the contents of an Accept-Language header as defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and a list of corresponding quality weights.
ParseBase parses a 2- or 3-letter ISO 639 code.
ParseExtension parses s as an extension and returns it on success.
ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
ParseScript parses a 4-letter ISO 15924 code.
ParseVariant parses and returns a Variant.
PreferSameScript will, in the absence of a match, result in the first preferred tag with the same script as a supported tag to match this supported tag.

# Constants

All canonicalizations.
All canonicalizations recommended by BCP 47.
The CLDR flag should be used if full compatibility with CLDR is required.
CLDRVersion is the CLDR version from which the tables in this package are derived.
Default is the canonicalization used by Parse, Make and Compose.
Replace all deprecated tags with their preferred replacements.
Replace deprecated base languages with their preferred replacements.
Replace deprecated regions with their preferred replacements.
Replace deprecated scripts with their preferred replacements.
exact match or explicitly specified value.
value is generally assumed to be the correct match.
Normalize legacy encodings.
most likely value picked out of a set of alternatives.
Map the dominant language of a macro language group to the macro language subtag.
full confidence that there was no match.
NumCompactTags is the number of common tags.
Raw can be used to Compose or Parse without Canonicalization.
Remove redundant scripts.

# Variables

af.
sq.
en-US.
am.
ar.
hy.
az.
bn.
pt-BR.
en-GB.
bg.
my.
fr-CA.
ca.
zh.
hr.
cs.
da.
nl.
en.
ErrMissingLikelyTagsData indicates no information was available to compute likely values of missing tags.
et.
pt-PT.
es-ES.
fil.
fi.
fr.
ka.
de.
el.
gu.
he.
hi.
hu.
is.
id.
it.
ja.
kn.
kk.
km.
ky.
ko.
lo.
es-419.
lv.
lt.
mk.
ms.
ml.
mr.
ar-001.
mn.
ne.
no.
fa.
pl.
pt.
pa.
ro.
ru.
sr.
sr-Latn.
zh-Hans.
si.
sk.
sl.
es.
Supported defines a Coverage that lists all supported subtags.
sw.
sv.
ta.
te.
th.
zh-Hant.
tr.
uk.
No description provided by the author
ur.
uz.
vi.
zu.

# Structs

Base is an ISO 639 language code, used for encoding the base language of a language tag.
Extension is a single BCP 47 extension.
Region is an ISO 3166-1 or UN M.49 code for representing countries and regions.
Script is a 4-letter ISO 15924 code for representing scripts.
Tag represents a BCP 47 language tag.
ValueError is returned by any of the parsing functions when the input is well-formed but the respective subtag is not recognized as a valid value.
Variant represents a registered variant of a language as defined by BCP 47.

# Interfaces

The Coverage interface is used to define the level of coverage of an internationalization service.
Matcher is the interface that wraps the Match method.

# Type aliases

CanonType can be used to enable or disable various types of canonicalization.
Confidence indicates the level of certainty for a given return value.
A MatchOption configures a Matcher.