Fall back to related languages for missing translations
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- sqlite, typescript
調査の方向性
Start with src/app/server_translations.ts, the main implementation file named in the issue. Trace how translations are read, saved, and revisioned, then identify the editor and migration entry points for the remaining requirements. Done means fallback follows LANGUAGES order, inherited values are handled correctly on save, revisions detect fallback edits, the editor identifies inherited text, and the one-time cleanup is complete.
索引モデルが issue の本文から書いたものです。
説明
Problem
Regional variants of a language (e.g. de-AT and de-DE) are translated independently. Every text has to be stored redundantly in each variant, and the variants can silently drift apart when only one is updated.
Proposal
When a text has no translation in the requested language, fall back to the other languages with the same base code before using the main language. The chain is derived automatically from the LANGUAGES order, so no configuration is needed:
de-AT→ otherde-*languages (inLANGUAGESorder) → main language- Example with
LANGUAGES="en,de-DE,de-AT":de-AT→de-DE→en
A variant then only stores what actually differs (e.g. "Jänner", "Servus" in de-AT); everything else is inherited from its siblings. Listing languages in the right order controls preference (e.g. put de-DE before de-AT if de-CH should prefer it).
Implementation notes
- Reading: overlay the fallback languages' translations first, then the requested language's own translations. Fallback works per text/media property, as translations already do, so a page may mix sources.
- Saving: compare edits against the inherited view, not the main language. Otherwise untouched inherited text gets copied into the variant on the first save. Text equal to the inherited value removes the variant's override (consistent with today's "equal to the original removes the translation").
- Versions: the translation revision must include the fallback languages' rows, so editing
de-DEmarks an opende-ATeditor as stale. - Editor: in translation mode, indicate which texts are inherited from a fallback language and which are overridden.
- Migration: one-time cleanup that removes variant values identical to their fallback.
Trade-offs
- A variant can no longer deliberately show the main-language text while a sibling has a translation (it would fall back to the sibling).
- Overrides don't follow later changes in the fallback language. That's usually intended, but could go stale unnoticed. A "fallback changed" indicator could be a follow-up.
Most of the change would live in src/app/server_translations.ts.
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 149
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
michael/editable のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
michael/editable#195 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
michael/editable#181 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
michael/editable の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
farion1231/cc-switch#8829 ·
メンテナーはふだん 1 日以内に返信
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverオープンdoc-audit enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100