From 85240ab8582fa28cfa94dcffa13eb83ba02121c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 11 Nov 2026 21:32:23 +0100 Subject: [PATCH] fix(records): give the visit, vaccination and workout refusals a sentence The visit, vaccination, allergy, address-book and workout forms read a refusal's code through the catalogue, but nineteen of the codes their routes send had no sentence: a stale doctor or check-up, a planned visit that would close a check-up, a dose without a name, a booster that cannot be planned, an invalid body, a workout batch that is too large. Each of them read as the form's generic "could not be saved", which hides what the person can change. They now have their own sentence in all ten languages. --- messages/de.json | 31 +++++++++++ messages/en.json | 31 +++++++++++ messages/es.json | 31 +++++++++++ messages/fr.json | 31 +++++++++++ messages/it.json | 31 +++++++++++ messages/ko.json | 31 +++++++++++ messages/nl.json | 31 +++++++++++ messages/pl.json | 31 +++++++++++ messages/pt-BR.json | 31 +++++++++++ messages/ru.json | 31 +++++++++++ src/lib/api/__tests__/localized-error.test.ts | 54 +++++++++++++++++++ 11 files changed, 364 insertions(+) diff --git a/messages/de.json b/messages/de.json index 8ee193b89..13bcb27aa 100644 --- a/messages/de.json +++ b/messages/de.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Diese Adresse liegt in einem privaten Netz. Der Betreiber muss ihren genauen Ursprung erst in AI_PRIVATE_ORIGINS freigeben." + }, + "encounter": { + "invalid": "Prüfe die Angaben zum Termin und versuche es erneut.", + "practitioner-not-found": "Diese Praxis bzw. dieser Arzt existiert nicht mehr. Wähle einen anderen Eintrag oder keinen.", + "reminder-not-found": "Diese Vorsorge existiert nicht mehr. Wähle eine andere oder keine.", + "reminder-conflict": "Ein geplanter Termin kann keine Vorsorge abschließen, denn er hat noch nicht stattgefunden." + }, + "vaccination": { + "invalid": "Prüfe die Angaben zur Impfung und versuche es erneut.", + "practitioner-not-found": "Diese Praxis bzw. dieser Arzt existiert nicht mehr. Wähle einen anderen Eintrag oder keinen.", + "encounter-not-found": "Dieser Termin existiert nicht mehr. Wähle einen anderen oder keinen.", + "custom-vaccine-not-found": "Dieser Impfstoff existiert nicht mehr. Wähle ihn erneut aus der Liste.", + "not-found": "Diese Impfung ist nicht mehr vorhanden.", + "identity-required": "Eine Impfung braucht einen Namen: Wähle einen Impfstoff aus der Liste oder gib ein, was im Impfpass steht.", + "booster-invalid": "Prüfe die Angaben zur Auffrischung und versuche es erneut.", + "booster-no-antigen": "Diese Impfung nennt keinen Impfstoff aus dem Katalog, daher lässt sich keine Auffrischung planen.", + "booster-out-of-scope": "Deine Freigabe für diese Akte reicht nicht, um eine Auffrischung zu planen." + }, + "allergy": { + "invalid": "Prüfe die Angaben zur Allergie und versuche es erneut." + }, + "practitioner": { + "invalid": "Prüfe die Angaben zur Praxis bzw. zum Arzt und versuche es erneut." + }, + "workout": { + "batch": { + "invalid": "Prüfe die Angaben zum Training und versuche es erneut.", + "too_large": "Zu viele Trainings auf einmal. Schicke weniger auf einmal.", + "payload_too_large": "Die Trainingsdaten sind zu groß, um sie auf einmal zu speichern.", + "source_not_permitted": "Diese Verbindung darf keine Trainings unter dieser Quelle speichern." + } } }, "doctorReport": { diff --git a/messages/en.json b/messages/en.json index 5a5554e39..6ba260ae3 100644 --- a/messages/en.json +++ b/messages/en.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "This address is on a private network. The operator has to allow its exact origin in AI_PRIVATE_ORIGINS before it can be used." + }, + "encounter": { + "invalid": "Check the visit details and try again.", + "practitioner-not-found": "This practice or doctor no longer exists. Choose another or none.", + "reminder-not-found": "This checkup no longer exists. Choose another or none.", + "reminder-conflict": "A planned visit cannot close a checkup, because it has not happened yet." + }, + "vaccination": { + "invalid": "Check the vaccination details and try again.", + "practitioner-not-found": "This practice or doctor no longer exists. Choose another or none.", + "encounter-not-found": "This visit no longer exists. Choose another or none.", + "custom-vaccine-not-found": "This vaccine no longer exists. Choose it again from the list.", + "not-found": "This vaccination is no longer available.", + "identity-required": "A dose needs a name: pick a vaccine from the list or type what the record says.", + "booster-invalid": "Check the booster details and try again.", + "booster-no-antigen": "This dose names no vaccine from the catalogue, so no booster can be planned for it.", + "booster-out-of-scope": "Your access to this record does not cover planning a booster." + }, + "allergy": { + "invalid": "Check the allergy details and try again." + }, + "practitioner": { + "invalid": "Check the practice or doctor details and try again." + }, + "workout": { + "batch": { + "invalid": "Check the workout details and try again.", + "too_large": "Too many workouts at once. Send fewer at a time.", + "payload_too_large": "The workout data is too large to save in one go.", + "source_not_permitted": "This connection may not save workouts under that source." + } } }, "doctorReport": { diff --git a/messages/es.json b/messages/es.json index 283ba8e2f..62128c707 100644 --- a/messages/es.json +++ b/messages/es.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Esta dirección está en una red privada. El operador tiene que permitir antes su origen exacto en AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Comprueba los datos de la cita e inténtalo de nuevo.", + "practitioner-not-found": "Esta consulta o este médico ya no existe. Elige otro o ninguno.", + "reminder-not-found": "Esta revisión ya no existe. Elige otra o ninguna.", + "reminder-conflict": "Una cita prevista no puede cerrar una revisión, porque todavía no ha tenido lugar." + }, + "vaccination": { + "invalid": "Comprueba los datos de la vacuna e inténtalo de nuevo.", + "practitioner-not-found": "Esta consulta o este médico ya no existe. Elige otro o ninguno.", + "encounter-not-found": "Esta cita ya no existe. Elige otra o ninguna.", + "custom-vaccine-not-found": "Esta vacuna ya no existe. Elígela de nuevo en la lista.", + "not-found": "Esta vacuna ya no está disponible.", + "identity-required": "Una dosis necesita un nombre: elige una vacuna de la lista o escribe lo que pone el registro.", + "booster-invalid": "Comprueba los datos del refuerzo e inténtalo de nuevo.", + "booster-no-antigen": "Esta dosis no indica ninguna vacuna del catálogo, así que no se puede planificar un refuerzo.", + "booster-out-of-scope": "Tu acceso a este registro no permite planificar un refuerzo." + }, + "allergy": { + "invalid": "Comprueba los datos de la alergia e inténtalo de nuevo." + }, + "practitioner": { + "invalid": "Comprueba los datos de la consulta o del médico e inténtalo de nuevo." + }, + "workout": { + "batch": { + "invalid": "Comprueba los datos del entrenamiento e inténtalo de nuevo.", + "too_large": "Demasiados entrenamientos a la vez. Envía menos cada vez.", + "payload_too_large": "Los datos del entrenamiento son demasiado grandes para guardarlos de una vez.", + "source_not_permitted": "Esta conexión no puede guardar entrenamientos con esa fuente." + } } }, "doctorReport": { diff --git a/messages/fr.json b/messages/fr.json index a04c2fd05..f9885e3c5 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Cette adresse se trouve sur un réseau privé. L’opérateur doit d’abord autoriser son origine exacte dans AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Vérifiez les informations du rendez-vous et réessayez.", + "practitioner-not-found": "Ce cabinet ou ce médecin n'existe plus. Choisissez-en un autre ou aucun.", + "reminder-not-found": "Ce dépistage n'existe plus. Choisissez-en un autre ou aucun.", + "reminder-conflict": "Un rendez-vous prévu ne peut pas clore un dépistage, car il n'a pas encore eu lieu." + }, + "vaccination": { + "invalid": "Vérifiez les informations de la vaccination et réessayez.", + "practitioner-not-found": "Ce cabinet ou ce médecin n'existe plus. Choisissez-en un autre ou aucun.", + "encounter-not-found": "Ce rendez-vous n'existe plus. Choisissez-en un autre ou aucun.", + "custom-vaccine-not-found": "Ce vaccin n'existe plus. Choisissez-le à nouveau dans la liste.", + "not-found": "Cette vaccination n'est plus disponible.", + "identity-required": "Une dose a besoin d'un nom : choisissez un vaccin dans la liste ou saisissez ce qu'indique le carnet.", + "booster-invalid": "Vérifiez les informations du rappel et réessayez.", + "booster-no-antigen": "Cette dose ne cite aucun vaccin du catalogue, aucun rappel ne peut donc être prévu.", + "booster-out-of-scope": "Votre accès à ce dossier ne permet pas de prévoir un rappel." + }, + "allergy": { + "invalid": "Vérifiez les informations de l'allergie et réessayez." + }, + "practitioner": { + "invalid": "Vérifiez les informations du cabinet ou du médecin et réessayez." + }, + "workout": { + "batch": { + "invalid": "Vérifiez les informations de l'entraînement et réessayez.", + "too_large": "Trop d'entraînements à la fois. Envoyez-en moins à la fois.", + "payload_too_large": "Les données d'entraînement sont trop volumineuses pour être enregistrées en une fois.", + "source_not_permitted": "Cette connexion n'a pas le droit d'enregistrer des entraînements sous cette source." + } } }, "doctorReport": { diff --git a/messages/it.json b/messages/it.json index 2be4d5cf8..f78033c05 100644 --- a/messages/it.json +++ b/messages/it.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Questo indirizzo si trova in una rete privata. L’operatore deve prima consentirne l’origine esatta in AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Controlla i dati dell'appuntamento e riprova.", + "practitioner-not-found": "Questo studio o medico non esiste più. Scegline un altro o nessuno.", + "reminder-not-found": "Questo controllo non esiste più. Scegline un altro o nessuno.", + "reminder-conflict": "Un appuntamento previsto non può chiudere un controllo, perché non è ancora avvenuto." + }, + "vaccination": { + "invalid": "Controlla i dati della vaccinazione e riprova.", + "practitioner-not-found": "Questo studio o medico non esiste più. Scegline un altro o nessuno.", + "encounter-not-found": "Questo appuntamento non esiste più. Scegline un altro o nessuno.", + "custom-vaccine-not-found": "Questo vaccino non esiste più. Sceglilo di nuovo dall'elenco.", + "not-found": "Questa vaccinazione non è più disponibile.", + "identity-required": "Una dose ha bisogno di un nome: scegli un vaccino dall'elenco o scrivi quello che riporta il libretto.", + "booster-invalid": "Controlla i dati del richiamo e riprova.", + "booster-no-antigen": "Questa dose non indica alcun vaccino del catalogo, quindi non si può pianificare un richiamo.", + "booster-out-of-scope": "Il tuo accesso a questa cartella non consente di pianificare un richiamo." + }, + "allergy": { + "invalid": "Controlla i dati dell'allergia e riprova." + }, + "practitioner": { + "invalid": "Controlla i dati dello studio o del medico e riprova." + }, + "workout": { + "batch": { + "invalid": "Controlla i dati dell'allenamento e riprova.", + "too_large": "Troppi allenamenti in una volta. Inviane meno alla volta.", + "payload_too_large": "I dati dell'allenamento sono troppo grandi per salvarli in una volta.", + "source_not_permitted": "Questa connessione non può salvare allenamenti con questa fonte." + } } }, "doctorReport": { diff --git a/messages/ko.json b/messages/ko.json index 8bee83435..c62750df2 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "이 주소는 사설 네트워크에 있어요. 운영자가 먼저 AI_PRIVATE_ORIGINS에 정확한 출처를 허용해야 해요." + }, + "encounter": { + "invalid": "진료 정보를 확인하고 다시 시도해 주세요.", + "practitioner-not-found": "이 병원 또는 의사가 더 이상 없어요. 다른 항목을 고르거나 선택하지 마세요.", + "reminder-not-found": "이 건강검진이 더 이상 없어요. 다른 검진을 고르거나 선택하지 마세요.", + "reminder-conflict": "예정된 진료는 아직 이루어지지 않았기 때문에 건강검진을 완료할 수 없어요." + }, + "vaccination": { + "invalid": "예방접종 정보를 확인하고 다시 시도해 주세요.", + "practitioner-not-found": "이 병원 또는 의사가 더 이상 없어요. 다른 항목을 고르거나 선택하지 마세요.", + "encounter-not-found": "이 진료가 더 이상 없어요. 다른 진료를 고르거나 선택하지 마세요.", + "custom-vaccine-not-found": "이 백신이 더 이상 없어요. 목록에서 다시 골라 주세요.", + "not-found": "이 예방접종 기록은 더 이상 없어요.", + "identity-required": "접종에는 이름이 필요해요. 목록에서 백신을 고르거나 기록에 적힌 이름을 입력하세요.", + "booster-invalid": "추가 접종 정보를 확인하고 다시 시도해 주세요.", + "booster-no-antigen": "이 접종에는 목록의 백신이 지정되지 않아 추가 접종을 계획할 수 없어요.", + "booster-out-of-scope": "이 기록에 대한 권한으로는 추가 접종을 계획할 수 없어요." + }, + "allergy": { + "invalid": "알레르기 정보를 확인하고 다시 시도해 주세요." + }, + "practitioner": { + "invalid": "병원 또는 의사 정보를 확인하고 다시 시도해 주세요." + }, + "workout": { + "batch": { + "invalid": "운동 정보를 확인하고 다시 시도해 주세요.", + "too_large": "한 번에 운동이 너무 많아요. 조금씩 나눠서 보내 주세요.", + "payload_too_large": "운동 데이터가 너무 커서 한 번에 저장할 수 없어요.", + "source_not_permitted": "이 연결로는 해당 출처의 운동을 저장할 수 없어요." + } } }, "doctorReport": { diff --git a/messages/nl.json b/messages/nl.json index 680cb970c..da1aa2e27 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Dit adres ligt in een privénetwerk. De beheerder moet de exacte origin eerst toestaan in AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Controleer de gegevens van het bezoek en probeer het opnieuw.", + "practitioner-not-found": "Deze praktijk of arts bestaat niet meer. Kies een andere of geen.", + "reminder-not-found": "Deze controle bestaat niet meer. Kies een andere of geen.", + "reminder-conflict": "Een gepland bezoek kan geen controle afsluiten, want het heeft nog niet plaatsgevonden." + }, + "vaccination": { + "invalid": "Controleer de gegevens van de vaccinatie en probeer het opnieuw.", + "practitioner-not-found": "Deze praktijk of arts bestaat niet meer. Kies een andere of geen.", + "encounter-not-found": "Dit bezoek bestaat niet meer. Kies een ander of geen.", + "custom-vaccine-not-found": "Dit vaccin bestaat niet meer. Kies het opnieuw uit de lijst.", + "not-found": "Deze vaccinatie is niet meer beschikbaar.", + "identity-required": "Een dosis heeft een naam nodig: kies een vaccin uit de lijst of typ wat er in het boekje staat.", + "booster-invalid": "Controleer de gegevens van de booster en probeer het opnieuw.", + "booster-no-antigen": "Deze dosis noemt geen vaccin uit de catalogus, dus er kan geen booster worden gepland.", + "booster-out-of-scope": "Je toegang tot dit dossier dekt het plannen van een booster niet." + }, + "allergy": { + "invalid": "Controleer de gegevens van de allergie en probeer het opnieuw." + }, + "practitioner": { + "invalid": "Controleer de gegevens van de praktijk of arts en probeer het opnieuw." + }, + "workout": { + "batch": { + "invalid": "Controleer de gegevens van de training en probeer het opnieuw.", + "too_large": "Te veel trainingen tegelijk. Stuur er minder per keer.", + "payload_too_large": "De trainingsgegevens zijn te groot om in één keer op te slaan.", + "source_not_permitted": "Deze koppeling mag geen trainingen onder die bron opslaan." + } } }, "doctorReport": { diff --git a/messages/pl.json b/messages/pl.json index f688e8ad1..854b541fe 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Ten adres jest w sieci prywatnej. Operator musi najpierw dopuścić jego dokładne źródło w AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Sprawdź dane wizyty i spróbuj ponownie.", + "practitioner-not-found": "Ten gabinet lub lekarz już nie istnieje. Wybierz inny albo żaden.", + "reminder-not-found": "To badanie już nie istnieje. Wybierz inne albo żadne.", + "reminder-conflict": "Zaplanowana wizyta nie może zamknąć badania, bo jeszcze się nie odbyła." + }, + "vaccination": { + "invalid": "Sprawdź dane szczepienia i spróbuj ponownie.", + "practitioner-not-found": "Ten gabinet lub lekarz już nie istnieje. Wybierz inny albo żaden.", + "encounter-not-found": "Ta wizyta już nie istnieje. Wybierz inną albo żadną.", + "custom-vaccine-not-found": "Ta szczepionka już nie istnieje. Wybierz ją ponownie z listy.", + "not-found": "To szczepienie nie jest już dostępne.", + "identity-required": "Dawka potrzebuje nazwy: wybierz szczepionkę z listy albo wpisz to, co widnieje w dokumentacji.", + "booster-invalid": "Sprawdź dane dawki przypominającej i spróbuj ponownie.", + "booster-no-antigen": "Ta dawka nie wskazuje szczepionki z katalogu, więc nie da się zaplanować dawki przypominającej.", + "booster-out-of-scope": "Twój dostęp do tej kartoteki nie obejmuje planowania dawki przypominającej." + }, + "allergy": { + "invalid": "Sprawdź dane alergii i spróbuj ponownie." + }, + "practitioner": { + "invalid": "Sprawdź dane gabinetu lub lekarza i spróbuj ponownie." + }, + "workout": { + "batch": { + "invalid": "Sprawdź dane treningu i spróbuj ponownie.", + "too_large": "Za dużo treningów naraz. Wysyłaj mniej za jednym razem.", + "payload_too_large": "Dane treningu są za duże, by zapisać je za jednym razem.", + "source_not_permitted": "To połączenie nie może zapisywać treningów pod tym źródłem." + } } }, "doctorReport": { diff --git a/messages/pt-BR.json b/messages/pt-BR.json index 17035a7a1..bf5265f6e 100644 --- a/messages/pt-BR.json +++ b/messages/pt-BR.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Este endereço está em uma rede privada. O operador precisa primeiro permitir a origem exata em AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Verifique os dados da consulta e tente novamente.", + "practitioner-not-found": "Esta clínica ou médico não existe mais. Escolha outro ou nenhum.", + "reminder-not-found": "Este check não existe mais. Escolha outro ou nenhum.", + "reminder-conflict": "Uma consulta planejada não pode fechar um check, porque ainda não aconteceu." + }, + "vaccination": { + "invalid": "Verifique os dados da vacina e tente novamente.", + "practitioner-not-found": "Esta clínica ou médico não existe mais. Escolha outro ou nenhum.", + "encounter-not-found": "Esta consulta não existe mais. Escolha outra ou nenhuma.", + "custom-vaccine-not-found": "Esta vacina não existe mais. Escolha-a novamente na lista.", + "not-found": "Esta vacina não está mais disponível.", + "identity-required": "Uma dose precisa de um nome: escolha uma vacina da lista ou digite o que consta no registro.", + "booster-invalid": "Verifique os dados do reforço e tente novamente.", + "booster-no-antigen": "Esta dose não indica nenhuma vacina do catálogo, então não é possível planejar um reforço.", + "booster-out-of-scope": "Seu acesso a este registro não permite planejar um reforço." + }, + "allergy": { + "invalid": "Verifique os dados da alergia e tente novamente." + }, + "practitioner": { + "invalid": "Verifique os dados da clínica ou do médico e tente novamente." + }, + "workout": { + "batch": { + "invalid": "Verifique os dados do treino e tente novamente.", + "too_large": "Treinos demais de uma vez. Envie menos por vez.", + "payload_too_large": "Os dados do treino são grandes demais para salvar de uma vez.", + "source_not_permitted": "Esta conexão não pode salvar treinos com essa origem." + } } }, "doctorReport": { diff --git a/messages/ru.json b/messages/ru.json index 05d5c1372..d207f54f6 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -191,6 +191,37 @@ }, "ai_provider": { "private_host": "Этот адрес находится в частной сети. Сначала оператор должен разрешить его точный источник в AI_PRIVATE_ORIGINS." + }, + "encounter": { + "invalid": "Проверьте данные визита и попробуйте снова.", + "practitioner-not-found": "Этой клиники или врача больше нет. Выберите другую запись или никакую.", + "reminder-not-found": "Этого осмотра больше нет. Выберите другой или никакой.", + "reminder-conflict": "Запланированный визит не может закрыть осмотр, потому что он ещё не состоялся." + }, + "vaccination": { + "invalid": "Проверьте данные вакцинации и попробуйте снова.", + "practitioner-not-found": "Этой клиники или врача больше нет. Выберите другую запись или никакую.", + "encounter-not-found": "Этого визита больше нет. Выберите другой или никакой.", + "custom-vaccine-not-found": "Этой вакцины больше нет. Выберите её в списке ещё раз.", + "not-found": "Этой вакцинации больше нет.", + "identity-required": "У дозы должно быть название: выберите вакцину из списка или введите то, что указано в записи.", + "booster-invalid": "Проверьте данные ревакцинации и попробуйте снова.", + "booster-no-antigen": "В этой дозе не указана вакцина из каталога, поэтому ревакцинацию запланировать нельзя.", + "booster-out-of-scope": "Ваш доступ к этой карте не позволяет планировать ревакцинацию." + }, + "allergy": { + "invalid": "Проверьте данные аллергии и попробуйте снова." + }, + "practitioner": { + "invalid": "Проверьте данные клиники или врача и попробуйте снова." + }, + "workout": { + "batch": { + "invalid": "Проверьте данные тренировки и попробуйте снова.", + "too_large": "Слишком много тренировок за раз. Отправляйте меньше за один раз.", + "payload_too_large": "Данные тренировки слишком велики, чтобы сохранить их за один раз.", + "source_not_permitted": "Это подключение не может сохранять тренировки с таким источником." + } } }, "doctorReport": { diff --git a/src/lib/api/__tests__/localized-error.test.ts b/src/lib/api/__tests__/localized-error.test.ts index b828bf842..33bc278f0 100644 --- a/src/lib/api/__tests__/localized-error.test.ts +++ b/src/lib/api/__tests__/localized-error.test.ts @@ -7,7 +7,11 @@ import en from "../../../../messages/en.json"; import es from "../../../../messages/es.json"; import fr from "../../../../messages/fr.json"; import itCatalog from "../../../../messages/it.json"; +import ko from "../../../../messages/ko.json"; +import nl from "../../../../messages/nl.json"; import pl from "../../../../messages/pl.json"; +import ptBR from "../../../../messages/pt-BR.json"; +import ru from "../../../../messages/ru.json"; type Catalog = Record; @@ -160,4 +164,54 @@ describe("localizedApiError", () => { } }); }); + + describe("the refusals of the visit, vaccination, allergy, address-book and workout saves", () => { + // Each of these is a code the route sends to a form that reads it through + // `localizedApiError`; without a sentence the form says only "could not + // save", which hides a fix the person can make. + const codes = [ + "encounter.invalid", + "encounter.practitioner-not-found", + "encounter.reminder-not-found", + "encounter.reminder-conflict", + "vaccination.invalid", + "vaccination.not-found", + "vaccination.identity-required", + "vaccination.practitioner-not-found", + "vaccination.encounter-not-found", + "vaccination.custom-vaccine-not-found", + "vaccination.booster-invalid", + "vaccination.booster-no-antigen", + "vaccination.booster-out-of-scope", + "allergy.invalid", + "practitioner.invalid", + "workout.batch.invalid", + "workout.batch.too_large", + "workout.batch.payload_too_large", + "workout.batch.source_not_permitted", + ]; + + it.each([ + ["de", de], + ["en", en], + ["es", es], + ["fr", fr], + ["it", itCatalog], + ["ko", ko], + ["nl", nl], + ["pl", pl], + ["pt-BR", ptBR], + ["ru", ru], + ])("has a sentence of its own for each in %s", (_, locale) => { + const localT = translator(locale as Catalog); + for (const code of codes) { + const error = new ApiError("raw English server prose", 422, { + errorCode: code, + }); + expect(localizedApiError(error, localT, "common.error"), code).not.toBe( + localT("common.error"), + ); + } + }); + }); });