Browse Source

'the-end'

hfll
hflllll 1 month ago
parent
commit
b76574a45f
7 changed files with 4690 additions and 19 deletions
  1. +2
    -0
      src/App.vue
  2. +2
    -1
      src/components/layout/NavBar.vue
  3. +18
    -18
      src/i18n/index.ts
  4. +1167
    -0
      src/i18n/locales/ru.json
  5. +1167
    -0
      src/i18n/locales/th.json
  6. +1167
    -0
      src/i18n/locales/vi.json
  7. +1167
    -0
      src/i18n/locales/zh-TW.json

+ 2
- 0
src/App.vue View File

@ -12,6 +12,8 @@ const { locale } = useI18n();
const changeLanguage = (lang: string) => {
locale.value = lang;
localStorage.setItem('language', lang);
// 使
window.location.reload();
};
//


+ 2
- 1
src/components/layout/NavBar.vue View File

@ -29,6 +29,7 @@ const languages = [
{ code: 'ru', name: t('language.ru') },
{ code: 'th', name: t('language.th') },
{ code: 'vi', name: t('language.vi') },
{ code: 'zh_TW', name: t('language.zh-TW') },
];
//
@ -149,7 +150,7 @@ const emit = defineEmits(['changeLanguage']);
v-for="lang in languages"
:key="lang.code"
@click="changeLanguage(lang.code); toggleLangDropdown()"
class="block w-full text-left px-4 py-2 text-text-secondary hover:bg-background hover:text-text"
class="block w-full text-left px-4 py-1 text-text-secondary hover:bg-background hover:text-text"
:class="{ 'text-primary-light': locale === lang.code }"
>
{{ lang.name }}


+ 18
- 18
src/i18n/index.ts View File

@ -2,15 +2,15 @@ import { createI18n } from 'vue-i18n'
import en from './locales/en.json'
import zh from './locales/zh.json'
import ja from './locales/ja.json'
// import ar from './locales/ar.json'
// import fr from './locales/fr.json'
// import ko from './locales/ko.json'
// import ms from './locales/ms.json'
// import pt from './locales/pt.json'
// import ru from './locales/ru.json'
// import th from './locales/th.json'
// import vi from './locales/vi.json'
// import zh_TW from './locales/zh-TW.json'
import ar from './locales/ar.json'
import fr from './locales/fr.json'
import ko from './locales/ko.json'
import ms from './locales/ms.json'
import pt from './locales/pt.json'
import ru from './locales/ru.json'
import th from './locales/th.json'
import vi from './locales/vi.json'
import zh_TW from './locales/zh-TW.json'
// 获取浏览器语言或从本地存储中获取
const getBrowserLanguage = () => {
@ -37,15 +37,15 @@ const i18n = createI18n({
en,
zh,
ja,
// ar,
// fr,
// ko,
// ms,
// pt,
// ru,
// th,
// vi,
// zh_TW
ar,
fr,
ko,
ms,
pt,
ru,
th,
vi,
zh_TW
}
})

+ 1167
- 0
src/i18n/locales/ru.json
File diff suppressed because it is too large
View File


+ 1167
- 0
src/i18n/locales/th.json
File diff suppressed because it is too large
View File


+ 1167
- 0
src/i18n/locales/vi.json
File diff suppressed because it is too large
View File


+ 1167
- 0
src/i18n/locales/zh-TW.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save