LanguageTag class sealed

A language tag as defined in RFC 5646.

A language tag ("Tag") is a sequence of one or more subtags ("Subtag"), separated by a hyphen (-).

Some example language tags:

  • en: The ISO 639-1 code for English
  • en-AU: adds the ISO 3166-1 alpha-2 region code for Australia

Language tags are not case sensitive but the following guidance is recommended:

  • language tags are lowercase
  • region subtags are UPPERCASE
  • script subtags are Title Case
  • all other subtags are lowercase

This class will convert values to meet that guidance.

Implementers

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
no setter
type String
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

isValid(String value) bool
tryParse(String tag, {String separator = defaultSeparator}) LanguageTag?
Parses a language tag string into a LanguageTag variant.