From 4b39b3ad5efb0795b36d1ee3df3580e26b9c2f1e Mon Sep 17 00:00:00 2001 From: VnPower Date: Sun, 20 Oct 2024 12:12:44 +0700 Subject: [PATCH] Fix locale bug --- assets/views/about.jet.html | 2 +- i18n/rewrite.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/assets/views/about.jet.html b/assets/views/about.jet.html index 65bed5d..ca0e965 100644 --- a/assets/views/about.jet.html +++ b/assets/views/about.jet.html @@ -9,7 +9,7 @@

About PixivFE

PixivFE is an open-source alternative frontend for Pixiv, allowing you to enjoy artwork without unnecessary distractions.

- This instance is hosted by the owner of {{ .DomainName }}. If you're interested in hosting PixivFE yourself, please visit the source repository for more information.

+

This instance is hosted by the owner of {{ .DomainName }}. If you're interested in hosting PixivFE yourself, please visit the source repository for more information.

Disclaimer: This is NOT a pixiv's product and was NOT developed, created, or distributed by pixiv.

diff --git a/i18n/rewrite.go b/i18n/rewrite.go index 6af05ee..9f9bf69 100644 --- a/i18n/rewrite.go +++ b/i18n/rewrite.go @@ -70,6 +70,20 @@ func translationPairs_inner(locale string, file string) TrPairs { result := TrPairs{} for _, v := range staging { + if len(v.before) < 1 { + continue + } + if strings.Count(v.before, " ") < 1 { + result = append(result, ">"+v.before) + result = append(result, ">"+v.after) + result = append(result, "\t"+v.before) + result = append(result, "\t"+v.after) + result = append(result, "\""+v.before) + result = append(result, "\""+v.after) + result = append(result, " "+v.before) + result = append(result, " "+v.after) + continue + } result = append(result, v.before) result = append(result, v.after) }