Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add support for locale_behavior: "respect_accept_language"

オープン
#591 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
react, typescript

調査の方向性

packages/elements-react/src/context/provider.tsx の intl.locale 設定付近から始め、既存の utils 領域で locale の処理を確認してください。default OryProvider がどのように設定を受け取るかを追い、そのうえで accept-language をどのように解析し、project.enabled_locales と照合するかを定義してください。respect_accept_language がデフォルトでその locale を選択し、明示的な設定値が引き続きそれを上書きできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
187
フォーク
80
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ory/elements のほかの issue

ory/elements の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。