feat: Add date/time template options to template titles

This commit is contained in:
Tom Moor
2022-12-24 15:53:05 +00:00
parent b8f748be52
commit c41bd9592e
10 changed files with 126 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
import { i18n } from "i18next";
import { unicodeCLDRtoBCP47 } from "@shared/utils/date";
import Desktop from "./Desktop";
export function detectLanguage() {
@@ -14,7 +15,7 @@ export function changeLanguage(
if (toLanguageString && i18n.language !== toLanguageString) {
// Languages are stored in en_US format in the database, however the
// frontend translation framework (i18next) expects en-US
const locale = toLanguageString.replace("_", "-");
const locale = unicodeCLDRtoBCP47(toLanguageString);
i18n.changeLanguage(locale);
Desktop.bridge?.setSpellCheckerLanguages(["en-US", locale]);