From 28fe4dd01991313d540c4840435847a2a2b95998 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sat, 9 Apr 2022 23:00:42 +0800 Subject: [PATCH] :bug: Fix: Add "no more translations" judgment logic (#100) --- CHANGELOG.md | 7 ++++--- i18n/en.toml | 3 +++ i18n/zh-CN.toml | 3 +++ i18n/zh-TW.toml | 3 +++ layouts/partials/header.html | 8 ++++++-- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65db84d4..57f95106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,11 @@ All notable changes to this project will be documented in this file. ## v0.2.14 - :recycle: Refactor: header layout - - :tada: Add sub menu (nested menu) support ([#31](https://github.com/Lruihao/FixIt/issues/31)) + - :tada: Feat: add sub menu (nested menu) support ([#31](https://github.com/Lruihao/FixIt/issues/31)) - :sparkles: Feat: add user-defined content to menu items via the params field ([#99](https://github.com/Lruihao/FixIt/issues/99)) - - :sparkles: Modified language selector to submenu (@pandaoh[`eced169`](https://github.com/Lruihao/FixIt/commit/eced169713ce4a0208ce70ab556824e47eb671d5), @Lruihao[#31](https://github.com/Lruihao/FixIt/issues/31)) - - :bug: Fix some header css bug ([#31](https://github.com/Lruihao/FixIt/issues/31)) + - :sparkles: Feat: modified language selector to submenu (@pandaoh[`eced169`](https://github.com/Lruihao/FixIt/commit/eced169713ce4a0208ce70ab556824e47eb671d5), @Lruihao[#31](https://github.com/Lruihao/FixIt/issues/31)) + - :bug: Fix: add "no more translations" judgment logic ([#100](https://github.com/Lruihao/FixIt/issues/100)) + - :bug: Fix: fix some header css bug ([#31](https://github.com/Lruihao/FixIt/issues/31)) - :zap: Perf: remove third-party library clipboard.js ([#84](https://github.com/Lruihao/FixIt/issues/84)) - :pencil2: Docs: fix highlight url typo in `theme-documentation-built-in-shortcodes` (@d-baer[#85](https://github.com/Lruihao/FixIt/pull/85)) - **Full Changelog:** @Lruihao [`v0.2.13...v0.2.14`](https://github.com/Lruihao/FixIt/compare/v0.2.13...v0.2.14) diff --git a/i18n/en.toml b/i18n/en.toml index 828f7773..2c491fa9 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -45,6 +45,9 @@ other = "More" [selectLanguage] other = "Select Language" +[noMoretTranslations] +other = "No more translations" + [switchTheme] other = "Switch Theme" # === partials/header.html === diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index 2f20d0d1..b6e23975 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -46,6 +46,9 @@ other = "更多" [selectLanguage] other = "选择语言" +[noMoretTranslations] +other = "没有更多翻译" + [switchTheme] other = "切换主题" # === partials/header.html === diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml index f5ded089..99136196 100644 --- a/i18n/zh-TW.toml +++ b/i18n/zh-TW.toml @@ -46,6 +46,9 @@ other = "更多" [selectLanguage] other = "選擇語言" +[noMoretTranslations] +other = "沒有更多翻譯" + [switchTheme] other = "切換主題" # === partials/header.html === diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f62e02d6..c60027da 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -101,7 +101,7 @@ {{- end -}} {{- end -}} - {{- else -}} + {{- else if gt (len .AllTranslations) 1 -}} {{- range .AllTranslations -}} {{- if ne .Lang $.Lang -}}