diff --git a/packages/frontend/quasar.config.js b/packages/frontend/quasar.config.js index f8487a9..28f598e 100644 --- a/packages/frontend/quasar.config.js +++ b/packages/frontend/quasar.config.js @@ -131,6 +131,10 @@ module.exports = configure(function (ctx) { pathRewrite: { '^/api': 'api' } + }, + '/seahub': { + target: process.env.URL, + changeOrigin: true } }, port: 9000 diff --git a/packages/frontend/src/App.vue b/packages/frontend/src/App.vue index 364bcae..466d441 100644 --- a/packages/frontend/src/App.vue +++ b/packages/frontend/src/App.vue @@ -8,6 +8,8 @@ import { useTokenStore } from './stores/token'; import { useSocketStore } from './stores/websocketStore'; import axios from 'axios'; import { WebPlatform } from './utils/platform'; +import { supportLanguages } from './i18n'; +import { i18n } from './boot/i18n'; const platform = new WebPlatform(); @@ -58,6 +60,24 @@ export default defineComponent({ websocketStore.start(); }); + let terminusLanguage = ''; + let terminusLanguageInfo: any = document.querySelector( + 'meta[name="terminus-language"]' + ); + if (terminusLanguageInfo && terminusLanguageInfo.content) { + terminusLanguage = terminusLanguageInfo.content; + } else { + terminusLanguage = navigator.language; + } + + console.log(navigator.language); + + if (terminusLanguage) { + if (supportLanguages.find((e) => e.value == terminusLanguage)) { + i18n.global.locale.value = terminusLanguage as any; + } + } + return {}; } }); diff --git a/packages/frontend/src/pages/Search/TextSearch.vue b/packages/frontend/src/pages/Search/TextSearch.vue index 2a928f8..18a930e 100644 --- a/packages/frontend/src/pages/Search/TextSearch.vue +++ b/packages/frontend/src/pages/Search/TextSearch.vue @@ -27,108 +27,112 @@ />