Merge pull request #1251 from dareoon/feat/i18n-pt-br

This commit is contained in:
Marc-André Bombeck committed 2026-10-22 14:19:17 +02:00
commit 402daa2753
6 files changed
+15683 -1

No files matched your search

+15646
View File
File diff suppressed because it is too large. Load diff
@@ -92,6 +92,7 @@ describe("CoachReadStrip — the latest reading's day", () => {
nl: "1 oktober",
ko: "10월 1일",
pl: "1 października",
"pt-BR": "1 de outubro",
};
for (const [locale, date] of Object.entries(expected) as Array<
[Locale, string]
@@ -41,6 +41,7 @@
* button is the open-trigger.
*/
import type { Locale } from "@/lib/i18n/config";
import { useCallback, useId, useRef, useState } from "react";
import { Loader2, Sparkles } from "lucide-react";
@@ -72,7 +73,7 @@ export interface NaturalLanguageExtractorProps {
* UI locale forwarded to the route as a hint. The route accepts an
* undefined value and falls back to the resolver chain.
*/
locale?: "en" | "de" | "es" | "fr" | "it" | "pl" | "ko" | "nl";
locale?: Locale;
/**
* Optional override of the API path so the wizard test harness can
* point at a mock server. Defaults to the production route.
@@ -883,6 +883,15 @@ const POPULATION_NORM_PATTERNS: Record<Locale, readonly RegExp[]> = {
], // No `\b` next to Hangul (it is an ASCII \w boundary), and the object sits
// between subject and verb in Korean, so each entry allows a gap where the
// Latin banks put \s+.
"pt-BR": [
/\bfaixa\s+(?:de\s+refer[eê]ncia|normal)\b/i,
/\bvalor(?:es)?\s+de\s+refer[eê]ncia\b/i,
/\b(?:adultos?|pessoas?)\s+saud[áa]ve(?:l|is)\b/i,
/\bmaioria\s+(?:dos\s+)?(?:adultos?|das\s+pessoas)\b/i,
/\b(?:diretrizes|guias|m[eé]dicos?|especialistas?)\b[^.?!]{0,30}\b(?:recomend(?:am|a)|suger(?:em|e)|indic(?:am|a))\b/i,
/\b(?:adultos?|pessoas?)\b[^.?!]{0,30}\b(?:geralmente|normalmente|em\s+geral)\b[^.?!]{0,30}\b(?:precis(?:am|a)|devem|necessit(?:am|a))\b/i,
/\b(?:entre|de)\s+[^.?!]{0,30}\b(?:normalmente|geralmente|em\s+geral)\b/i,
],
ko: [
/정상\s*범위(?:는|가|를|로|의)/,
/(?:참고|기준|권장)\s*(?:범위|치|값)/,
@@ -255,6 +255,7 @@ describe("tone harness — deterministic fallbacks", () => {
it: /non è disponibile alcuna valutazione/,
pl: /nie ma (?:tu )?żadnej oceny/,
nl: /geen beoordeling/,
"pt-BR": /n[aã]o h[áa] (?:uma )?avalia[çc][aã]o/i,
ko: /평가가 없어요/,
};
+24
View File
@@ -293,6 +293,30 @@ export const RANGE_PROSE: Record<Locale, RangeProse> = {
// matchers here are prefix-anchored, so only the prefix-shaped notation is
// listed. A postfixed Korean range still falls through to text-only, which
// `isUnreadableRange` reports rather than hides.
"pt-BR": {
twoSided: ["a", "e"],
upper: [
"ate",
"menos de",
"abaixo de",
"inferior a",
"maximo",
"no maximo",
],
lower: [
"a partir de",
"no minimo",
"minimo",
"acima de",
"maior que",
"maior de",
],
filler: [
"valores de referencia",
"valor de referencia",
"faixa de referencia",
],
},
ko: {
twoSided: ["에서", "부터"],
upper: ["최대", "최고"],