fix: Correct HTML lang attribute in source. closes #6534
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user