fix: Correct HTML lang attribute in source. closes #6534

This commit is contained in:
Tom Moor
2024-02-16 12:44:17 -05:00
parent 69eb7b9db4
commit 2b0a8d1f7c
3 changed files with 13 additions and 1 deletions

View File

@@ -106,6 +106,16 @@ export function unicodeBCP47toCLDR(locale: string) {
return locale.replace("-", "_").replace("und", "root");
}
/**
* Converts a locale string from Unicode CLDR format to ISO 639 format.
*
* @param locale The locale string to convert
* @returns The converted locale string
*/
export function unicodeCLDRtoISO639(locale: string) {
return locale.split("_")[0];
}
/**
* Returns the current date as a string formatted depending on current locale.
*