mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 12:46:49 +00:00
feat: Add dropdown for language switch
Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
This commit is contained in:
@@ -11,7 +11,7 @@ export default ({app, store}) => {
|
||||
// This way we can use it globally in our components through this.$i18n
|
||||
app.i18n = new VueI18n({
|
||||
// Set the initial locale
|
||||
locale: "en",
|
||||
locale: store.state.windows.language,
|
||||
|
||||
// Set the fallback locale in case the current locale can't be found
|
||||
fallbackLocale: "en",
|
||||
@@ -20,14 +20,18 @@ export default ({app, store}) => {
|
||||
messages: {
|
||||
en: require("~/static/lang/en.json"),
|
||||
zh: require("~/static/lang/zh.json"),
|
||||
ja: require("~/static/lang/ja.json"),
|
||||
// ja: require("~/static/lang/ja.json"),
|
||||
fr: require("~/static/lang/fr.json")
|
||||
}
|
||||
});
|
||||
|
||||
store.watch(
|
||||
(state) => state.windows.language,
|
||||
(language) => app.i18n.locale = language
|
||||
(language) => {
|
||||
if (app.i18n.availableLocales.includes(language)) {
|
||||
app.i18n.locale = language
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user