Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
11 lines
339 B
TypeScript
11 lines
339 B
TypeScript
/** Validate/canonicalize the tag; available translation catalogs belong to the UI. */
|
|
export function interactionLanguage(value: unknown): string | undefined {
|
|
if (typeof value !== "string") return undefined;
|
|
try {
|
|
const [canonical] = Intl.getCanonicalLocales(value);
|
|
return canonical;
|
|
} catch {
|
|
return undefined;
|
|
}
|
|
}
|