Categorise constructed languages.

This commit is contained in:
Paul 2021-08-04 12:31:51 +01:00
parent 6d8a8e14dd
commit 184663a3ac
3 changed files with 23 additions and 14 deletions

2
external/lang vendored

@ -1 +1 @@
Subproject commit 0da16a539dc35a0050119e1a239bd0b31eb7b962 Subproject commit da8e3f8bb3cc01867e2f3fb731e2a5a26cdab0f5

View file

@ -59,7 +59,7 @@ export interface LanguageEntry {
i18n: string; i18n: string;
dayjs?: string; dayjs?: string;
rtl?: boolean; rtl?: boolean;
alt?: boolean; cat?: "const" | "alt";
} }
export const Languages: { [key in Language]: LanguageEntry } = { export const Languages: { [key in Language]: LanguageEntry } = {
@ -97,12 +97,6 @@ export const Languages: { [key in Language]: LanguageEntry } = {
ru: { display: "Русский", emoji: "🇷🇺", i18n: "ru" }, ru: { display: "Русский", emoji: "🇷🇺", i18n: "ru" },
sr: { display: "Српски", emoji: "🇷🇸", i18n: "sr" }, sr: { display: "Српски", emoji: "🇷🇸", i18n: "sr" },
sv: { display: "Svenska", emoji: "🇸🇪", i18n: "sv" }, sv: { display: "Svenska", emoji: "🇸🇪", i18n: "sv" },
tokipona: {
display: "Toki Pona",
emoji: "🙂",
i18n: "tokipona",
dayjs: "en-gb",
},
tr: { display: "Türkçe", emoji: "🇹🇷", i18n: "tr" }, tr: { display: "Türkçe", emoji: "🇹🇷", i18n: "tr" },
uk: { display: "Українська", emoji: "🇺🇦", i18n: "uk" }, uk: { display: "Українська", emoji: "🇺🇦", i18n: "uk" },
zh_Hans: { zh_Hans: {
@ -112,33 +106,41 @@ export const Languages: { [key in Language]: LanguageEntry } = {
dayjs: "zh", dayjs: "zh",
}, },
tokipona: {
display: "Toki Pona",
emoji: "🙂",
i18n: "tokipona",
dayjs: "en-gb",
cat: "const",
},
owo: { owo: {
display: "OwO", display: "OwO",
emoji: "🐱", emoji: "🐱",
i18n: "owo", i18n: "owo",
dayjs: "en-gb", dayjs: "en-gb",
alt: true, cat: "alt",
}, },
pr: { pr: {
display: "Pirate", display: "Pirate",
emoji: "🏴‍☠️", emoji: "🏴‍☠️",
i18n: "pr", i18n: "pr",
dayjs: "en-gb", dayjs: "en-gb",
alt: true, cat: "alt",
}, },
bottom: { bottom: {
display: "Bottom", display: "Bottom",
emoji: "🥺", emoji: "🥺",
i18n: "bottom", i18n: "bottom",
dayjs: "en-gb", dayjs: "en-gb",
alt: true, cat: "alt",
}, },
piglatin: { piglatin: {
display: "Pig Latin", display: "Pig Latin",
emoji: "🐖", emoji: "🐖",
i18n: "piglatin", i18n: "piglatin",
dayjs: "en-gb", dayjs: "en-gb",
alt: true, cat: "alt",
}, },
}; };

View file

@ -55,7 +55,7 @@ export function Component(props: Props) {
</h3> </h3>
<div className={styles.list}> <div className={styles.list}>
{languages {languages
.filter(([, lang]) => !lang.alt) .filter(([, lang]) => !lang.cat)
.map(([x, lang]) => ( .map(([x, lang]) => (
<Entry key={x} entry={[x, lang]} {...props} /> <Entry key={x} entry={[x, lang]} {...props} />
))} ))}
@ -63,12 +63,19 @@ export function Component(props: Props) {
<h3> <h3>
<Text id="app.settings.pages.language.const" /> <Text id="app.settings.pages.language.const" />
</h3> </h3>
<div className={styles.list}>
{languages
.filter(([, lang]) => lang.cat === "const")
.map(([x, lang]) => (
<Entry key={x} entry={[x, lang]} {...props} />
))}
</div>
<h3> <h3>
<Text id="app.settings.pages.language.other" /> <Text id="app.settings.pages.language.other" />
</h3> </h3>
<div className={styles.list}> <div className={styles.list}>
{languages {languages
.filter(([, lang]) => lang.alt) .filter(([, lang]) => lang.cat === "alt")
.map(([x, lang]) => ( .map(([x, lang]) => (
<Entry key={x} entry={[x, lang]} {...props} /> <Entry key={x} entry={[x, lang]} {...props} />
))} ))}