mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
feat(settings/i18n): filter only display languages
This commit is contained in:
parent
775fd3f22b
commit
d582fdea02
@ -1,7 +1,7 @@
|
||||
import OptionsWidget from "../options_widget.js";
|
||||
import server from "../../../../services/server.js";
|
||||
import utils from "../../../../services/utils.js";
|
||||
import { getAvailableLocales, t, type Locale } from "../../../../services/i18n.js";
|
||||
import { getAvailableLocales, t } from "../../../../services/i18n.js";
|
||||
import type { OptionMap } from "../../../../../../services/options_interface.js";
|
||||
|
||||
const TPL = `
|
||||
@ -47,7 +47,7 @@ export default class LocalizationOptions extends OptionsWidget {
|
||||
}
|
||||
|
||||
async optionsLoaded(options: OptionMap) {
|
||||
const availableLocales = getAvailableLocales();
|
||||
const availableLocales = getAvailableLocales().filter(l => !l.contentOnly);
|
||||
this.$localeSelect.empty();
|
||||
|
||||
for (const locale of availableLocales) {
|
||||
|
@ -11,6 +11,8 @@ export interface Locale {
|
||||
name: string;
|
||||
/** `true` if the language is a right-to-left one, or `false` if it's left-to-right. */
|
||||
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;
|
||||
}
|
||||
|
||||
const LOCALES: Locale[] = [
|
||||
@ -51,22 +53,26 @@ const LOCALES: Locale[] = [
|
||||
{ // Arabic
|
||||
id: "ar",
|
||||
name: "اَلْعَرَبِيَّةُ",
|
||||
rtl: true
|
||||
rtl: true,
|
||||
contentOnly: true
|
||||
},
|
||||
{ // Hebrew
|
||||
id: "he",
|
||||
name: "עברית",
|
||||
rtl: true
|
||||
rtl: true,
|
||||
contentOnly: true
|
||||
},
|
||||
{ // Kurdish
|
||||
id: "ku",
|
||||
name: "کوردی",
|
||||
rtl: true
|
||||
rtl: true,
|
||||
contentOnly: true
|
||||
},
|
||||
{ // Persian
|
||||
id: "fa",
|
||||
name: "فارسی",
|
||||
rtl: true
|
||||
rtl: true,
|
||||
contentOnly: true
|
||||
}
|
||||
].sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user