The name of the language, written in any language
The ISO 639-1 tag of the language name refers to, or undefined if name refers to no language the
runtime knows, or to more than one language in the different locales it is written in
import { identifyTag } from "@grafctory/core/language";
identifyTag("German"); // "de"
identifyTag("Français"); // "fr"
identifyTag("francais"); // "fr" - accents ignored
identifyTag("de"); // undefined - a tag, not a name
nameTag for the converse, naming the language a tag identifies
Identifies the language a name refers to.
Resolves languages named in words rather than in tags, whatever language the name is written in:
German,tedesco,Deutschandallemandall identifyde. Names are matched ignoring case, accents and surrounding whitespace. A name that different locales give to different languages, asAkan, identifies none of them: an ambiguous name is never resolved by a guess the caller could mistake for a reliable match.Names are supplied by the JavaScript runtime: the names recognised vary with the platform, and only languages with a two-letter ISO 639-1 code are identified, so that
Hawaiian, codedhawalone, identifies nothing.