mirror of
https://github.com/ONLYOFFICE/desktop-sdk.git
synced 2026-02-10 18:15:05 +08:00
AIAgent: update changing lang
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -34,13 +34,14 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
|
||||
});
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
console.log(window.RendererProcessVariable);
|
||||
if (window.RendererProcessVariable) {
|
||||
i18n.changeLanguage("en");
|
||||
i18n.changeLanguage(window.RendererProcessVariable.lang);
|
||||
}
|
||||
|
||||
window.on_update_plugin_info = (info) => {
|
||||
if (info.lang) {
|
||||
i18n.changeLanguage("en");
|
||||
i18n.changeLanguage(info.lang);
|
||||
}
|
||||
|
||||
if (info.theme) {
|
||||
|
||||
@ -2,6 +2,15 @@ import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
|
||||
import en from "./translations/en.json";
|
||||
import ru from "./translations/ru.json";
|
||||
import cs from "./translations/cs.json";
|
||||
import de from "./translations/de.json";
|
||||
import es from "./translations/es.json";
|
||||
import fr from "./translations/fr.json";
|
||||
import it from "./translations/it.json";
|
||||
import pl from "./translations/pl.json";
|
||||
import ptBr from "./translations/pt-br.json";
|
||||
import sk from "./translations/sk.json";
|
||||
|
||||
i18n
|
||||
.use(initReactI18next) // passes i18n down to react-i18next
|
||||
@ -10,6 +19,33 @@ i18n
|
||||
en: {
|
||||
translation: en,
|
||||
},
|
||||
ru: {
|
||||
translation: ru,
|
||||
},
|
||||
"cs-CZ": {
|
||||
translation: cs,
|
||||
},
|
||||
de: {
|
||||
translation: de,
|
||||
},
|
||||
es: {
|
||||
translation: es,
|
||||
},
|
||||
fr: {
|
||||
translation: fr,
|
||||
},
|
||||
it: {
|
||||
translation: it,
|
||||
},
|
||||
pl: {
|
||||
translation: pl,
|
||||
},
|
||||
"pt-BR": {
|
||||
translation: ptBr,
|
||||
},
|
||||
"sl-SI": {
|
||||
translation: sk,
|
||||
},
|
||||
},
|
||||
fallbackLng: "en",
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
"Yes": "Да",
|
||||
"No": "Нет",
|
||||
"WelcomeTitle": "Чем я могу помочь?",
|
||||
"WelcomeDescription": "Бесплатный ИИ-чат, помощник в написании и генератор идей",
|
||||
"WelcomeDescription": "Бесплатный ИИ-чат, помощник в создании документов и генератор идей",
|
||||
"Rename": "Переименовать",
|
||||
"Download": "Загрузить",
|
||||
"Search": "Поиск...",
|
||||
|
||||
Reference in New Issue
Block a user