Refactor: shared locale data module for all locale-aware components
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 40/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, tailwindcss, typescript
- Área
- frontend, internationalization
Línea de trabajo
Start by comparing the locale tables in src/registry/components/language-switcher.tsx and src/registry/components/navbar.tsx to see where their coverage and lookup rules differ. Then check src/registry/registry.ts to see how a new registry entry is declared. The work is done when the new src/registry/components/locale-data.ts exports the helpers, both components use it instead of their own tables, and the locale-data unit tests and existing component tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Refactor: shared locale data module
LanguageSwitcher and NavBar each carry their own copy of locale display data:
language-switcher.tsx—LANG_TO_FLAG,LANG_NAMES,RTL_LOCALES(~90 languages)navbar.tsx—LOCALE_MAP(~35 languages, label + flag only, no RTL)
The two have drifted (different coverage, different lookup rules), and every new locale-aware component (pill switcher, locale picker, RTL wrapper) will need the same data.
Proposal
- Add
src/registry/components/locale-data.tsexportinggetLocaleLabel(code, mode),getLocaleFlag(code),isRtlLocale(code)and aresolveLocale(locale: Locale)helper that applieslabel/flag/rtloverrides. - Fall back to
Intl.DisplayNamesfor languages not in the built-in table instead of returning the raw code. - Register it in
src/registry/registry.ts(e.g.locale-data) so shadcn installs pull it in as aregistryDependency. - Migrate
LanguageSwitcherandNavBarto it; delete the duplicate tables.
Acceptance
- No locale table left inside individual components
- Unit tests for
locale-data.ts(overrides, region subtags, unknown codes, RTL) - Existing component tests still pass
See ARCHITECTURE.md.
- Lenguaje dominante
- TypeScript
- Estrellas
- 39
- Forks
- 16
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de babelize/babelize-elements
-
bug website
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
babelize/babelize-elements#46 ·
Los mantenedores suelen responder en 1 día
-
bug language-switcher priority: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
babelize/babelize-elements#26 ·
Los mantenedores suelen responder en 1 día
-
component enhancement help wanted
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
babelize/babelize-elements#47 ·
Los mantenedores suelen responder en 1 día
-
bug component rtl-layout
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
babelize/babelize-elements#45 ·
Los mantenedores suelen responder en 1 día
-
Website: revamp and improve the landing pagePosiblemente ocupada @anjalinayak01 la tomó hace 4 días. Abiertoenhancement help wanted priority: medium website
Dificultad 4/5 Más de una semana Aptitud para principiantes 30/100
babelize/babelize-elements#37 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de babelize/babelize-elements
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vercel/streamdown#673 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
docs(stream-protocol): document messageMetatadata on start/finish and the message-metadata chunkPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertofactory-active task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
vercel/ai#23375 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
agilepathway/label-checker#721 ·
Los mantenedores suelen responder en 1 día
-
CLI Empathy needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
chromaui/chromatic-cli#1524 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día