web: locales: rename fr_FR to fr to match transifex

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt 2023-09-28 22:17:30 +02:00 committed by risson
parent 29de5d34d6
commit 9c3ff1d71b
5 changed files with 7 additions and 10 deletions

View File

@ -4,7 +4,7 @@
"targetLocales": [
"en",
"pseudo-LOCALE",
"fr_FR",
"fr",
"tr",
"es",
"pl",

View File

@ -29,7 +29,7 @@ export class AKLocaleSensitiveDemoComponent extends LitElement {
export const InFrench = () =>
html`<div style="background: #fff; padding: 4em">
<ak-locale-context locale="fr_FR"
<ak-locale-context locale="fr"
><ak-locale-demo-component
>Everything is not ok.</ak-locale-demo-component
></ak-locale-context
@ -39,12 +39,12 @@ export const InFrench = () =>
export const SwitchingBackAndForth = () => {
let lang = "en";
window.setInterval(() => {
lang = lang === "en" ? "fr_FR" : "en";
lang = lang === "en" ? "fr" : "en";
window.dispatchEvent(customEvent(EVENT_LOCALE_REQUEST, { locale: lang }));
}, 1000);
return html`<div style="background: #fff; padding: 4em">
<ak-locale-context locale="fr_FR">
<ak-locale-context locale="fr">
<ak-locale-sensitive-demo-component></ak-locale-sensitive-demo-component
></ak-locale-context>
</div>`;

View File

@ -24,9 +24,6 @@ export { enLocale };
// language uses both "regional" and "script" suffixes. The regexes use the language and any region
// or script.
//
// French is currently an oddity; the translator provided the France regional version explicitly,
// and we fall back to that regardless of region. Sorry, Québécois.
//
// Chinese locales usually (but not always) use the script rather than region suffix. The default
// (optional) fallback for Chinese (zh) is "Chinese (simplified)", which is why it has that odd
// regex syntax at the end which means "match zh as long as it's not followed by a [:word:] token";
@ -43,7 +40,7 @@ const LOCALE_TABLE: LocaleRow[] = [
["en", /^en([_-]|$)/i, () => msg("English"), async () => await import("@goauthentik/locales/en")],
["es", /^es([_-]|$)/i, () => msg("Spanish"), async () => await import("@goauthentik/locales/es")],
["de", /^de([_-]|$)/i, () => msg("German"), async () => await import("@goauthentik/locales/de")],
["fr_FR", /^fr([_-]|$)/i, () => msg("French"), async () => await import("@goauthentik/locales/fr_FR")],
["fr", /^fr([_-]|$)/i, () => msg("French"), async () => await import("@goauthentik/locales/fr")],
["pl", /^pl([_-]|$)/i, () => msg("Polish"), async () => await import("@goauthentik/locales/pl")],
["tr", /^tr([_-]|$)/i, () => msg("Turkish"), async () => await import("@goauthentik/locales/tr")],
["zh-Hant", /^zh[_-](HK|Hant)/i, () => msg("Chinese (traditional)"), async () => await import("@goauthentik/locales/zh-Hant")],

View File

@ -14,7 +14,7 @@ export const targetLocales = [
`de`,
`en`,
`es`,
`fr_FR`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,
@ -31,7 +31,7 @@ export const allLocales = [
`en`,
`en`,
`es`,
`fr_FR`,
`fr`,
`pl`,
`pseudo-LOCALE`,
`tr`,