mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-11 02:58:49 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user