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:
parent
543b942be1
commit
289c802a0b
4 changed files with 88 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue