Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add support for locale_behavior: "respect_accept_language"

Abierto
#591 4 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
react, typescript

Línea de trabajo

Empieza en packages/elements-react/src/context/provider.tsx, alrededor de la configuración de intl.locale, e inspecciona el área existente de utils para el manejo de locales. Sigue cómo el default OryProvider recibe la configuración y, después, define cómo debe analizarse accept-language y compararse con project.enabled_locales. Se considera terminado cuando respect_accept_language selecciona esa locale de forma predeterminada, mientras que un valor de configuración explícito sigue sobrescribiéndola.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Needs Triage
Preflight checklist
Ory Network Project

No response

Describe your problem

Currently, it seems like this mode is not supported, since there are no references to the "accept-language" header in the library.

In fact, it is not the key: project.default_locale which is used (as the name would perhaps suggest), but the intl.locale config key https://github.com/ory/elements/blob/795b1bda1f7236874fb7686f5fbf51237ff290a1/packages/elements-react/src/context/provider.tsx#L83.

Describe your ideal solution

I would expect the behaviour of the default OryProvider to interpret the "accept-language" header in "respect_accept_language" mode, and use that as the default application language, unless otherwise overridden in the config object.

I imagine that this would entail adding another function to "utils" which parses the header and possibly cross-references it with the project.enabled_locales array from config. Once this approach is approved, I'd be happy to open a PR.

Workarounds or alternatives

I was looking at using window.navigator.language as an alternative but this would mean that the config object would need to be rendered client-side.

Version

main 795b1bda1f7236874fb7686f5fbf51237ff290a1

Additional Context

No response

Lenguaje dominante
TypeScript
Estrellas
187
Forks
80
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ory/elements

Todos los issues de ory/elements

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.