web: the return of pseudolocalization (#7190)
* web: the return of pseudolocalization The move to lit-locale lost the ability to automagically pseudolocalize the UI, a useful utility for checking that additions to the UI have been properly cataloged as translation targets. This short script (barely 40 lines) digs deep into the lit-localize toolkit and produces a pretranslated translation bundle in the target format folder. * Linted, prettied, and commented.
This commit is contained in:
@ -35,6 +35,11 @@ export { enLocale };
|
||||
// - Text Label
|
||||
// - Locale loader.
|
||||
|
||||
// prettier-ignore
|
||||
const debug: LocaleRow = [
|
||||
"pseudo-LOCALE", /^pseudo/i, () => msg("Pseudolocale (for testing)"), async () => await import("@goauthentik/locales/pseudo-LOCALE"),
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const LOCALE_TABLE: LocaleRow[] = [
|
||||
["en", /^en([_-]|$)/i, () => msg("English"), async () => await import("@goauthentik/locales/en")],
|
||||
@ -46,6 +51,7 @@ const LOCALE_TABLE: LocaleRow[] = [
|
||||
["zh-Hant", /^zh[_-](HK|Hant)/i, () => msg("Chinese (traditional)"), async () => await import("@goauthentik/locales/zh-Hant")],
|
||||
["zh_TW", /^zh[_-]TW$/i, () => msg("Taiwanese Mandarin"), async () => await import("@goauthentik/locales/zh_TW")],
|
||||
["zh-Hans", /^zh(\b|_)/i, () => msg("Chinese (simplified)"), async () => await import("@goauthentik/locales/zh-Hans")],
|
||||
debug
|
||||
];
|
||||
|
||||
export const LOCALES: AkLocale[] = LOCALE_TABLE.map(([code, match, label, locale]) => ({
|
||||
|
Reference in New Issue
Block a user