From 3ca10897bb157c2453c2df8ef847baed4dff321a Mon Sep 17 00:00:00 2001 From: Cheng Gu Date: Fri, 10 Jan 2025 00:18:30 +0800 Subject: [PATCH] Fix problem of broken navigation text in Chinese and set the correct value of html lang (#456) * feat: set correct html lang value with i18n locale * feat: do not wrap side menu text when locale is chinese --------- Co-authored-by: Katos <7927609+katosdev@users.noreply.github.com> --- frontend/app.vue | 6 +++++- frontend/layouts/default.vue | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index 8c48eb81..f6b0ade6 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -1,6 +1,6 @@ diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue index d6d917f1..1f7ab6cd 100644 --- a/frontend/layouts/default.vue +++ b/frontend/layouts/default.vue @@ -79,6 +79,7 @@ :to="n.to" :class="{ 'bg-secondary text-secondary-content': n.active?.value, + 'text-nowrap': typeof locale === 'string' && locale.startsWith('zh-'), }" > @@ -114,7 +115,7 @@ import MdiMenu from "~icons/mdi/menu"; import MdiPlus from "~icons/mdi/plus"; - const { t } = useI18n(); + const { t, locale } = useI18n(); const username = computed(() => authCtx.user?.name || "User"); const preferences = useViewPreferences();