Translate: Add DeepL support (#2721)

Co-authored-by: v <vendicated@riseup.net>
This commit is contained in:
Ashton 2024-08-01 07:10:27 -05:00 committed by GitHub
parent 2382294e8b
commit f8b01c1a31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 277 additions and 37 deletions

View file

@ -20,9 +20,8 @@ import { Margins } from "@utils/margins";
import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot } from "@utils/modal";
import { Forms, SearchableSelect, Switch, useMemo } from "@webpack/common";
import { Languages } from "./languages";
import { settings } from "./settings";
import { cl } from "./utils";
import { cl, getLanguages } from "./utils";
const LanguageSettingKeys = ["receivedInput", "receivedOutput", "sentInput", "sentOutput"] as const;
@ -31,7 +30,7 @@ function LanguageSelect({ settingsKey, includeAuto }: { settingsKey: typeof Lang
const options = useMemo(
() => {
const options = Object.entries(Languages).map(([value, label]) => ({ value, label }));
const options = Object.entries(getLanguages()).map(([value, label]) => ({ value, label }));
if (!includeAuto)
options.shift();