feat(localization): Add Traditional Chinese language translation (#759)

* Add translation for Traditional Chinese

* Add translation for Traditional Chinese: test

* Add translation for Traditional Chinese: Add PR number to CHANGELOG

* Add translation for Traditional Chinese: test: remove empty lines

* Add translation for Traditional Chinese: test: remove empty lines
This commit is contained in:
XLion 2025-07-07 03:59:00 +08:00 committed by GitHub
parent 543b942be1
commit 289c802a0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 88 additions and 1 deletions

View file

@ -43,6 +43,14 @@ func TestLocalizationService(t *testing.T) {
}
})
t.Run("Traditional Chinese localization", func(t *testing.T) {
localizer := service.GetLocalizer("zh-TW")
result := localizer.MustLocalize(&i18n.LocalizeConfig{MessageID: "loading"})
if result != "載入中..." {
t.Errorf("Expected '載入中...', got '%s'", result)
}
})
t.Run("All required keys exist in English", func(t *testing.T) {
localizer := service.GetLocalizer("en")
requiredKeys := []string{
@ -87,6 +95,21 @@ func TestLocalizationService(t *testing.T) {
}
}
})
t.Run("All required keys exist in Traditional Chinese", func(t *testing.T) {
localizer := service.GetLocalizer("zh-TW")
requiredKeys := []string{
"loading", "why_am_i_seeing", "protected_by", "made_with",
"mascot_design", "try_again", "go_home", "javascript_required",
}
for _, key := range requiredKeys {
result := localizer.MustLocalize(&i18n.LocalizeConfig{MessageID: key})
if result == "" {
t.Errorf("Key '%s' returned empty string", key)
}
}
})
}
type manifest struct {