event.preventDefault()}
>
= {
+ "en-US": enUS,
+ "es-ES": esES,
+ "pt-BR": ptBR,
+};
+
+const baseKeys = Object.keys(messages[BASE_LOCALE]);
+const translatedLocales = SUPPORTED_LOCALES.filter((locale) => locale !== BASE_LOCALE);
+
+describe("locale messages", () => {
+ it("provides a bundle for every supported locale", () => {
+ expect(Object.keys(messages).sort()).toEqual([...SUPPORTED_LOCALES].sort());
+ });
+
+ it.each(translatedLocales)("%s translates every message id defined by en-US", (locale) => {
+ const translated = new Set(Object.keys(messages[locale]));
+
+ expect(baseKeys.filter((key) => !translated.has(key))).toEqual([]);
+ });
+
+ it.each(translatedLocales)("%s defines no message ids missing from en-US", (locale) => {
+ const base = new Set(baseKeys);
+
+ expect(Object.keys(messages[locale]).filter((key) => !base.has(key))).toEqual([]);
+ });
+
+ it.each([...SUPPORTED_LOCALES])("%s has no blank messages", (locale) => {
+ const blank = Object.entries(messages[locale])
+ .filter(([, message]) => typeof message !== "string" || message.trim() === "")
+ .map(([key]) => key);
+
+ expect(blank).toEqual([]);
+ });
+});
diff --git a/src/i18n/locales/en-US/common.json b/src/i18n/locales/en-US/common.json
index 2ef2627..e2d5dab 100644
--- a/src/i18n/locales/en-US/common.json
+++ b/src/i18n/locales/en-US/common.json
@@ -24,8 +24,10 @@
"common.visibility.info.team": "Scoped to a team you belong to.",
"common.visibility.info.internal": "Visible to everyone signed into this platform. Not on the public internet.",
"common.search": "Search",
+ "common.search.clear": "Clear search",
"common.search.error": "Search failed. Please try again.",
"common.search.noResults": "No matching results.",
+ "common.search.resultCount": "{count, plural, =0 {No results} one {# result} other {# results}}",
"common.search.results": "Search results",
"common.search.searching": "Searching...",
"common.search.startTyping": "Type at least {count} characters to search.",
diff --git a/src/i18n/locales/es-ES/common.json b/src/i18n/locales/es-ES/common.json
index dfbe4ec..cbbff44 100644
--- a/src/i18n/locales/es-ES/common.json
+++ b/src/i18n/locales/es-ES/common.json
@@ -24,8 +24,10 @@
"common.visibility.info.team": "Limitado a un equipo al que perteneces.",
"common.visibility.info.internal": "Visible para todos los que han iniciado sesión en esta plataforma. No en la Internet pública.",
"common.search": "Buscar",
+ "common.search.clear": "Borrar búsqueda",
"common.search.error": "La búsqueda falló. Inténtalo de nuevo.",
"common.search.noResults": "No hay resultados coincidentes.",
+ "common.search.resultCount": "{count, plural, =0 {Sin resultados} one {# resultado} other {# resultados}}",
"common.search.results": "Resultados de búsqueda",
"common.search.searching": "Buscando...",
"common.search.startTyping": "Escribe al menos {count} caracteres para buscar.",
diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json
index c451a25..017a5b6 100644
--- a/src/i18n/locales/pt-BR/common.json
+++ b/src/i18n/locales/pt-BR/common.json
@@ -24,8 +24,10 @@
"common.visibility.info.team": "Restrito a uma equipe à qual você pertence.",
"common.visibility.info.internal": "Visível para todos que estão conectados a esta plataforma. Não na Internet pública.",
"common.search": "Buscar",
+ "common.search.clear": "Limpar busca",
"common.search.error": "A busca falhou. Tente novamente.",
"common.search.noResults": "Nenhum resultado correspondente.",
+ "common.search.resultCount": "{count, plural, =0 {Nenhum resultado} one {# resultado} other {# resultados}}",
"common.search.results": "Resultados da busca",
"common.search.searching": "Buscando...",
"common.search.startTyping": "Digite pelo menos {count} caracteres para buscar.",