From 7a8363a1edc00e4c65b97bb9df98e762bd331e3d Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Mon, 15 Jan 2024 19:57:50 +0800 Subject: [PATCH] fix: correct the UI locale for Chinese (#77) --- layouts/partials/decap-cms/functions/locale.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/layouts/partials/decap-cms/functions/locale.html b/layouts/partials/decap-cms/functions/locale.html index 40832ce..d8a4b24 100644 --- a/layouts/partials/decap-cms/functions/locale.html +++ b/layouts/partials/decap-cms/functions/locale.html @@ -1,2 +1,12 @@ +{{- $map := dict + "zh-cn" "zh_Hans" + "zh-hans" "zh_Hans" + "zh-hant" "zh_Hant" + "zh-hk" "zh_Hant" + "zh-tw" "zh_Hant" +}} {{- $locale := site.Language.LanguageCode }} +{{- with index $map $locale }} + {{- $locale = . }} +{{- end }} {{- return $locale }}