package server import "testing" func TestTranslationsHaveMatchingKeys(t *testing.T) { english := translations["en"] japanese := translations["ja"] for key := range english { if _, ok := japanese[key]; !ok { t.Errorf("Japanese translation is missing %q", key) } } for key := range japanese { if _, ok := english[key]; !ok { t.Errorf("English translation is missing %q", key) } } } func TestEditorJapaneseLabelsAreLocalized(t *testing.T) { keys := []string{ "editor.save", "editor.rename", "editor.history", "editor.delete", "editor.links", "editor.close", "editor.use_html", "editor.use_markdown", "editor.hide_preview", "editor.show_preview", } for _, key := range keys { if translations["ja"][key] == "" { t.Errorf("Japanese translation is empty for %q", key) } if translations["ja"][key] == translations["en"][key] { t.Errorf("Japanese translation was not localized for %q", key) } } }