Does localization API support ISO 639-2?

Tests to see if the implementation supports ISO 639-2 three alpha language codes. Both with and without a region code. Tests both B and T code for German ("ger" and "deu" respectively) Note: Chrome currently doesn’t support any region specific locales for German or French, so both will fall back to the base language.

by David Storey

JavaScript

console.clear();
console.log("ISO 639-2 language codes: ");

// Languages where ISO 639-1 language code exists
console.log("French:");
console.dirxml(new Intl.DateTimeFormat(["fra", "en-GB"]).resolvedOptions());
console.log("German (B code):");
console.dirxml(new Intl.DateTimeFormat(["ger", "en-GB"]).resolvedOptions());
console.log("German (T code):");
console.dirxml(new Intl.DateTimeFormat(["deu", "en-GB"]).resolvedOptions());
console.log("Spanish:");
console.dirxml(new Intl.DateTimeFormat(["spa", "en-GB"]).resolvedOptions());
console.log("English:");
console.dirxml(new Intl.DateTimeFormat(["eng", "en-GB"]).resolvedOptions());

// languages where ISO 639-1 code doesn’t exist
console.log("Cherokee: ");
console.dirxml(new Intl.DateTimeFormat(["chr-Latn", "en-GB"]).resolvedOptions());
console.log("Cherokee: ");
console.dirxml(new Intl.DateTimeFormat(["chr-Cher", "en-GB"]).resolvedOptions());
console.log("Mohawk: ");
console.dirxml(new Intl.DateTimeFormat(["moh-Latn", "en-GB"]).resolvedOptions());
console.log("Hawaiian: ");
console.dirxml(new Intl.DateTimeFormat(["haw-Latn", "en-GB"]).resolvedOptions());
console.log("Lower Sorbian: ");
console.dirxml(new Intl.DateTimeFormat(["dsb-Latn", "en-GB"]).resolvedOptions());
console.log("Upper Sorbian: ");
console.dirxml(new Intl.DateTimeFormat(["hsb-Latn", "en-GB"]).resolvedOptions());
console.log("Alsatian: ");
console.dirxml(new Intl.DateTimeFormat(["gsw-Latn", "en-GB"]).resolvedOptions());
console.log("Konkani: ");
console.dirxml(new Intl.DateTimeFormat(["kok-Latn", "en-GB"]).resolvedOptions());
console.log("Konkani: ");
console.dirxml(new Intl.DateTimeFormat(["kok-Deva", "en-GB"]).resolvedOptions());

console.log("\nISO 639-2 language codes with region code: ");
console.log("Swiss French:");
console.dirxml(new Intl.DateTimeFormat(["fra-CH", "en-GB"]).resolvedOptions());
console.log("Swiss German (B code):");
console.dirxml(new Intl.DateTimeFormat(["ger-CH", "en-GB"]).resolvedOptions());
console.log("Swiss German (T...