feat(client/rtl): hide English RTL from production

This commit is contained in:
Elian Doran 2025-10-08 21:35:57 +03:00
parent c4358d52d5
commit d35f97d99a
No known key found for this signature in database
2 changed files with 19 additions and 7 deletions

View File

@ -26,7 +26,11 @@ function LocalizationOptions() {
const { uiLocales, formattingLocales: contentLocales } = useMemo(() => {
const allLocales = getAvailableLocales();
return {
uiLocales: allLocales.filter(locale => !locale.contentOnly),
uiLocales: allLocales.filter(locale => {
if (locale.contentOnly) return false;
if (locale.devOnly && !glob.isDev) return false;
return true;
}),
formattingLocales: allLocales.filter(locale => locale.electronLocale),
}
}, []);

View File

@ -5,6 +5,8 @@ export interface Locale {
rtl?: boolean;
/** `true` if the language is not supported by the application as a display language, but it is selectable by the user for the content. */
contentOnly?: boolean;
/** `true` if the language should only be visible while in development mode, and not in production. */
devOnly?: boolean;
/** The value to pass to `--lang` for the Electron instance in order to set it as a locale. Not setting it will hide it from the list of supported locales. */
electronLocale?: "en" | "de" | "es" | "fr" | "zh_CN" | "zh_TW" | "ro" | "af" | "am" | "ar" | "bg" | "bn" | "ca" | "cs" | "da" | "el" | "en_GB" | "es_419" | "et" | "fa" | "fi" | "fil" | "gu" | "he" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "kn" | "ko" | "lt" | "lv" | "ml" | "mr" | "ms" | "nb" | "nl" | "pl" | "pt_BR" | "pt_PT" | "ru" | "sk" | "sl" | "sr" | "sv" | "sw" | "ta" | "te" | "th" | "tr" | "uk" | "ur" | "vi";
}
@ -28,7 +30,13 @@ const UNSORTED_LOCALES: Locale[] = [
*
* These are only displayed while in dev mode, to test some language particularities (such as RTL) more easily.
*/
{ id: "en_rtl", name: "English (right-to-left) [dev]", electronLocale: "en", rtl: true },
{
id: "en_rtl",
name: "English (right-to-left) [dev]",
electronLocale: "en",
rtl: true,
devOnly: true
},
/*
* Right to left languages