fix(i18n): hk language resource

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-09-24 15:12:12 +08:00
parent 1edef1dc32
commit 43c89e007d
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
3 changed files with 22 additions and 4 deletions

View File

@ -17,6 +17,7 @@ import common_ko from "../../../../locales/common/ko.json"
import common_pt from "../../../../locales/common/pt.json"
import common_ru from "../../../../locales/common/ru.json"
import common_zhCN from "../../../../locales/common/zh-CN.json"
import common_zhHK from "../../../../locales/common/zh-HK.json"
import common_zhTW from "../../../../locales/common/zh-TW.json"
import errors_en from "../../../../locales/errors/en.json"
import external_en from "../../../../locales/external/en.json"
@ -36,6 +37,7 @@ import lang_ko from "../../../../locales/lang/ko.json"
import lang_pt from "../../../../locales/lang/pt.json"
import lang_ru from "../../../../locales/lang/ru.json"
import lang_zhCN from "../../../../locales/lang/zh-CN.json"
import lang_zhHK from "../../../../locales/lang/zh-HK.json"
import lang_zhTW from "../../../../locales/lang/zh-TW.json"
import settings_en from "../../../../locales/settings/en.json"
import shortcuts_en from "../../../../locales/shortcuts/en.json"
@ -60,6 +62,11 @@ export const defaultResources = {
lang: lang_zhCN,
common: common_zhCN,
},
"zh-HK": {
lang: lang_zhHK,
common: common_zhHK,
},
ja: {
lang: lang_ja,
common: common_ja,

View File

@ -206,7 +206,7 @@ export const PictureMasonry: FC<MasonryProps> = (props) => {
entries.forEach((entry) => {
if (
entry.isIntersecting &&
entry.intersectionRatio >= 0.8 && // 检查元素是否从下方滑入视图
entry.intersectionRatio >= 0.8 &&
entry.boundingClientRect.top >= entry.rootBounds!.top
) {
entryIds.push((entry.target as HTMLDivElement).dataset.entryId as string)

View File

@ -242,10 +242,21 @@ export const LanguageSelector = () => {
? defaultResources[lang].lang.name
: langT(`langs.${lang}` as any)
const originalLanguageName = defaultResources[lang].lang.name
return (
<SelectItem key={lang} value={lang}>
{languageName}{" "}
{typeof percent === "number" ? (percent >= 100 ? null : `(${percent}%)`) : null}
<SelectItem className="group" key={lang} value={lang}>
<span className={cn(originalLanguageName !== languageName && "group-hover:hidden")}>
{languageName}
{typeof percent === "number" ? (percent >= 100 ? null : ` (${percent}%)`) : null}
</span>
{originalLanguageName !== languageName && (
<span
className="hidden duration-500 animate-in fade-in-0 group-hover:block"
key={"org"}
>
{originalLanguageName}
</span>
)}
</SelectItem>
)
})}