Skip to content

Commit

Permalink
✨ feat(translations): chinese translations (#316)
Browse files Browse the repository at this point in the history
* ✨ feat(translations): chinese translations

* ✨ feat(App.vue): append dropdown item
  • Loading branch information
ClarkQAQ authored Nov 1, 2024
1 parent bf91832 commit 486a6ac
Show file tree
Hide file tree
Showing 3 changed files with 499 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ const languageFlag = computed(() => {
if (lang === "en") {
lang = "us";
}
if (lang === "zh") {
lang = "cn";
}
return "fi-" + lang;
})
Expand Down Expand Up @@ -117,6 +120,7 @@ const currentYear = ref(new Date().getFullYear())
<a class="dropdown-item" href="#" @click.prevent="switchLanguage('de')"><span class="fi fi-de"></span> Deutsch</a>
<a class="dropdown-item" href="#" @click.prevent="switchLanguage('ru')"><span class="fi fi-ru"></span> Русский</a>
<a class="dropdown-item" href="#" @click.prevent="switchLanguage('vi')"><span class="fi fi-vi"></span> Tiếng Việt</a>
<a class="dropdown-item" href="#" @click.prevent="switchLanguage('zh')"><span class="fi fi-cn"></span> 中文</a>
</div>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/lang/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import de from './translations/de.json';
import ru from './translations/ru.json';
import en from './translations/en.json';
import vi from './translations/vi.json';
import zh from './translations/zh.json';
import {createI18n} from "vue-i18n";

// Create i18n instance with options
Expand All @@ -20,7 +21,8 @@ const i18n = createI18n({
"de": de,
"ru": ru,
"en": en,
"vi": vi
"vi": vi,
"zh": zh
}
});

Expand Down
Loading

0 comments on commit 486a6ac

Please sign in to comment.