From 9e948175b3ff81ddc2f3b08428380abc9ce6c7e1 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Wed, 25 May 2022 16:43:59 +0100 Subject: [PATCH] chore: update and add new languages --- .prettierrc.js | 3 +- external/lang | 2 +- package.json | 9 +- src/mobx/stores/LocaleOptions.ts | 1 + src/pages/settings/assets/flags/brittany.svg | 161 ++++++ .../assets/{ => flags}/enchanting_table.webp | Bin .../settings/assets/{ => flags}/esperanto.svg | 0 src/pages/settings/assets/flags/kurdistan.svg | 1 + src/pages/settings/assets/flags/sources.txt | 27 + .../tamil_nadu.png} | Bin src/pages/settings/assets/flags/toki_pona.svg | 276 ++++++++++ src/pages/settings/assets/flags/veneto.svg | 499 ++++++++++++++++++ src/pages/settings/assets/toki_pona.svg | 28 - src/pages/settings/panes/Languages.tsx | 56 +- yarn.lock | 23 +- 15 files changed, 1029 insertions(+), 57 deletions(-) create mode 100644 src/pages/settings/assets/flags/brittany.svg rename src/pages/settings/assets/{ => flags}/enchanting_table.webp (100%) rename src/pages/settings/assets/{ => flags}/esperanto.svg (100%) create mode 100644 src/pages/settings/assets/flags/kurdistan.svg create mode 100644 src/pages/settings/assets/flags/sources.txt rename src/pages/settings/assets/{tamil_nadu_flag.png => flags/tamil_nadu.png} (100%) create mode 100644 src/pages/settings/assets/flags/toki_pona.svg create mode 100644 src/pages/settings/assets/flags/veneto.svg delete mode 100644 src/pages/settings/assets/toki_pona.svg diff --git a/.prettierrc.js b/.prettierrc.js index d016bb18..e3019dc2 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -8,7 +8,8 @@ module.exports = { "/(lib)", "/(redux|mobx)", "/(context)", - "/(ui|common)|.svg|.webp|.png|.jpg$", + "/(ui|common)$", + ".svg|.webp|.png|.jpg$", "^[./]", ], importOrderSeparation: true, diff --git a/external/lang b/external/lang index 56dd2317..a322d933 160000 --- a/external/lang +++ b/external/lang @@ -1 +1 @@ -Subproject commit 56dd2317d317a0a5dcd0c77312b67f32b53390e8 +Subproject commit a322d93399dac70a8bbb696eed6656edb0e37cd0 diff --git a/package.json b/package.json index d858deb2..9217e8f2 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "dependencies": { "@fontsource/bitter": "^4.5.0", "@insertish/vite-plugin-babel-macros": "^1.0.5", + "@revoltchat/ui": "^1.0.31", "fs-extra": "^10.0.0", "klaw": "^3.0.0", "react-beautiful-dnd": "^13.1.0", @@ -91,7 +92,6 @@ "@fontsource/ubuntu-mono": "^4.4.5", "@hcaptcha/react-hcaptcha": "^0.3.6", "@preact/preset-vite": "^2.0.0", - "@revoltchat/ui": "1.0.31", "@rollup/plugin-replace": "^2.4.2", "@styled-icons/boxicons-logos": "^10.38.0", "@styled-icons/boxicons-regular": "^10.38.0", @@ -131,7 +131,7 @@ "markdown-it": "^12.0.6", "markdown-it-emoji": "^2.0.0", "mediasoup-client": "npm:@insertish/mediasoup-client@3.6.36-esnext", - "mobx": "^6.3.2", + "mobx": "^6.6.0", "mobx-react-lite": "^3.3.0", "preact": "^10.5.14", "preact-context-menu": "0.4.0-patch.0", @@ -162,5 +162,8 @@ "repository": "https://github.com/revoltchat/revite.git", "author": "Paul ", "license": "MIT", - "packageManager": "yarn@3.2.0" + "packageManager": "yarn@3.2.0", + "resolutions": { + "@revoltchat/ui": "portal:../components" + } } diff --git a/src/mobx/stores/LocaleOptions.ts b/src/mobx/stores/LocaleOptions.ts index 24a7161b..72abd6b2 100644 --- a/src/mobx/stores/LocaleOptions.ts +++ b/src/mobx/stores/LocaleOptions.ts @@ -31,6 +31,7 @@ export function findLanguage(lang?: string): Language { const value = Language[key as keyof typeof Language]; // Skip alternative/joke languages + if (Languages[value].cat === "const") continue; if (Languages[value].cat === "alt") continue; values.push(value); diff --git a/src/pages/settings/assets/flags/brittany.svg b/src/pages/settings/assets/flags/brittany.svg new file mode 100644 index 00000000..7376601d --- /dev/null +++ b/src/pages/settings/assets/flags/brittany.svg @@ -0,0 +1,161 @@ + + + +Created with Fabric.js 3.6.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/settings/assets/enchanting_table.webp b/src/pages/settings/assets/flags/enchanting_table.webp similarity index 100% rename from src/pages/settings/assets/enchanting_table.webp rename to src/pages/settings/assets/flags/enchanting_table.webp diff --git a/src/pages/settings/assets/esperanto.svg b/src/pages/settings/assets/flags/esperanto.svg similarity index 100% rename from src/pages/settings/assets/esperanto.svg rename to src/pages/settings/assets/flags/esperanto.svg diff --git a/src/pages/settings/assets/flags/kurdistan.svg b/src/pages/settings/assets/flags/kurdistan.svg new file mode 100644 index 00000000..11037b91 --- /dev/null +++ b/src/pages/settings/assets/flags/kurdistan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/pages/settings/assets/flags/sources.txt b/src/pages/settings/assets/flags/sources.txt new file mode 100644 index 00000000..98f6c95e --- /dev/null +++ b/src/pages/settings/assets/flags/sources.txt @@ -0,0 +1,27 @@ +Flag of Brittany +CC BY-SA 4.0 +https://commons.wikimedia.org/wiki/File:Flag_of_Brittany.svg + +Enchanting Table +Minecraft game render +https://minecraft.fandom.com/wiki/Enchanting_Table?file=Enchanting_Table.gif + +Flag of Esperanto +Public Domain +https://commons.wikimedia.org/wiki/File:Flag_of_Esperanto.svg + +Flag of Kurdistan +Public Domain +https://commons.wikimedia.org/wiki/File:Flag_of_Kurdistan.svg + +Tamil Nadu Flag +CC BY-SA 3.0 +https://commons.wikimedia.org/wiki/File:..Tamil_Nadu_Flag(INDIA).png + +Toki Pona Flag +Free for any use +https://www.reddit.com/r/tokipona/comments/mevzbn/a_flag_for_toki_pona/gsk3euc/ + +Flag of Veneto +CC BY-SA 3.0 +https://commons.wikimedia.org/wiki/File:Flag_of_Veneto.svg diff --git a/src/pages/settings/assets/tamil_nadu_flag.png b/src/pages/settings/assets/flags/tamil_nadu.png similarity index 100% rename from src/pages/settings/assets/tamil_nadu_flag.png rename to src/pages/settings/assets/flags/tamil_nadu.png diff --git a/src/pages/settings/assets/flags/toki_pona.svg b/src/pages/settings/assets/flags/toki_pona.svg new file mode 100644 index 00000000..371c37b9 --- /dev/null +++ b/src/pages/settings/assets/flags/toki_pona.svg @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/src/pages/settings/assets/flags/veneto.svg b/src/pages/settings/assets/flags/veneto.svg new file mode 100644 index 00000000..1afb7ec1 --- /dev/null +++ b/src/pages/settings/assets/flags/veneto.svg @@ -0,0 +1,499 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PAX + tibi + mar + ce e + van + geli + sta + mevs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/settings/assets/toki_pona.svg b/src/pages/settings/assets/toki_pona.svg deleted file mode 100644 index e29c05f6..00000000 --- a/src/pages/settings/assets/toki_pona.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Created by potrace 1.5, written by Peter Selinger 2001-2004 - - - - - - - - - - \ No newline at end of file diff --git a/src/pages/settings/panes/Languages.tsx b/src/pages/settings/panes/Languages.tsx index 7ea9d283..a555e56d 100644 --- a/src/pages/settings/panes/Languages.tsx +++ b/src/pages/settings/panes/Languages.tsx @@ -1,3 +1,4 @@ +import { Check } from "@styled-icons/boxicons-regular"; import { observer } from "mobx-react-lite"; import styles from "./Panes.module.scss"; @@ -6,19 +7,22 @@ import { useMemo } from "preact/hooks"; import { useApplicationState } from "../../../mobx/State"; -import Emoji from "../../../components/common/Emoji"; -import Checkbox from "../../../components/ui/Checkbox"; -import Tip from "../../../components/ui/Tip"; -import enchantingTableWEBP from "../assets/enchanting_table.webp"; -import esperantoFlagSVG from "../assets/esperanto.svg"; -import tamilFlagPNG from "../assets/tamil_nadu_flag.png"; -import tokiponaSVG from "../assets/toki_pona.svg"; +import britannyFlagSVG from "../assets/flags/brittany.svg"; +import enchantingTableWEBP from "../assets/flags/enchanting_table.webp"; +import esperantoFlagSVG from "../assets/flags/esperanto.svg"; +import kurdistanFlagSVG from "../assets/flags/kurdistan.svg"; +import tamilFlagPNG from "../assets/flags/tamil_nadu.png"; +import tokiponaSVG from "../assets/flags/toki_pona.svg"; +import venetoFlagSVG from "../assets/flags/veneto.svg"; import { Language, LanguageEntry, Languages as Langs, } from "../../../../external/lang/Languages"; +import Emoji from "../../../components/common/Emoji"; +import Checkbox from "../../../components/ui/Checkbox"; +import Tip from "../../../components/ui/Tip"; type Key = [Language, LanguageEntry]; @@ -40,22 +44,48 @@ function Entry({ entry: [x, lang], selected, onSelect }: Props) { checked={selected} onChange={onSelect}>
- {lang.i18n === "eo" ? ( + {lang.i18n === "vec" ? ( + + ) : lang.i18n === "br" ? ( + + ) : lang.i18n === "ckb" ? ( + + ) : lang.i18n === "eo" ? ( ) : lang.i18n === "ta" ? ( ) : lang.emoji === "🙂" ? ( - + ) : lang.emoji === "🪄" ? ( )}
- {lang.display} + + {lang.display} {lang.verified && } + ); } diff --git a/yarn.lock b/yarn.lock index 87e1b60b..0851b0f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2096,20 +2096,19 @@ __metadata: languageName: node linkType: hard -"@revoltchat/ui@npm:1.0.31": - version: 1.0.31 - resolution: "@revoltchat/ui@npm:1.0.31" +"@revoltchat/ui@portal:../components::locator=client%40workspace%3A.": + version: 0.0.0-use.local + resolution: "@revoltchat/ui@portal:../components::locator=client%40workspace%3A." dependencies: "@styled-icons/boxicons-logos": ^10.38.0 "@styled-icons/boxicons-regular": ^10.38.0 "@styled-icons/boxicons-solid": ^10.38.0 - mobx: ^6.5.0 + mobx: ^6.6.0 mobx-react-lite: ^3.3.0 peerDependencies: revolt-api: "*" - checksum: 8f93757d131ae7d784e744b774f6f6b9bea4e09a3fb48762334caf23e4ab08db209649eba1435f9fa82bdf7bfbfb78100fef6d13e7e0f715d0e2c82c52abf74d languageName: node - linkType: hard + linkType: soft "@rollup/plugin-babel@npm:^5.2.0": version: 5.3.0 @@ -3386,7 +3385,7 @@ __metadata: "@hcaptcha/react-hcaptcha": ^0.3.6 "@insertish/vite-plugin-babel-macros": ^1.0.5 "@preact/preset-vite": ^2.0.0 - "@revoltchat/ui": 1.0.31 + "@revoltchat/ui": ^1.0.31 "@rollup/plugin-replace": ^2.4.2 "@styled-icons/boxicons-logos": ^10.38.0 "@styled-icons/boxicons-regular": ^10.38.0 @@ -3428,7 +3427,7 @@ __metadata: markdown-it: ^12.0.6 markdown-it-emoji: ^2.0.0 mediasoup-client: "npm:@insertish/mediasoup-client@3.6.36-esnext" - mobx: ^6.3.2 + mobx: ^6.6.0 mobx-react-lite: ^3.3.0 preact: ^10.5.14 preact-context-menu: 0.4.0-patch.0 @@ -5867,10 +5866,10 @@ __metadata: languageName: node linkType: hard -"mobx@npm:^6.5.0": - version: 6.5.0 - resolution: "mobx@npm:6.5.0" - checksum: 1210fb0b1c515b5f0ec2916296c32ca19b733e03b34f180af382d44b90668a15b4143c69bb06ca8785ebc3da3e761c6c60d0e72c945c199efc823088af1941ab +"mobx@npm:^6.6.0": + version: 6.6.0 + resolution: "mobx@npm:6.6.0" + checksum: 369b8d6830ec286e9c856c80002c7a554d46bca739b7f76432cb56b3ce1fe0a7ed7e5a994b9793d30023beeff0dd16300a501e831fa97107104e4fedc7d4af8f languageName: node linkType: hard