Give the backend's English prose a code the frontend can translate
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python, typescript
調査の方向性
Read the Backend text section of docs/architecture/localization.md, then compare chat-error-text.ts and license-error-text.ts with one producer, such as artifacts/service.py, and its route test. Start with a single producer and write a backend test for its code and a frontend test for translated text plus the unknown-code fallback. Done means the covered prose has a code, interface-language text, and keeps the backend English fallback.
索引モデルが issue の本文から書いたものです。
説明
The gap
docs/architecture/localization.md lists this under Known gaps:
Backend prose without a code stays English in every language: model install messages, fit verdicts,
not_runnable_reason, a Studio format'sunavailable_reason, and the disk-spacedetailthatlib/api.tswraps in a translated sentence.
Why it matters
Someone running the app in Japanese or German meets English at exactly the moments the app is refusing or explaining itself: why a Studio format is greyed out, why a model card is flagged "Won't fit", why a model cannot run, what an install is doing, and why an upload failed for space. Those are the sentences a user most needs to read.
The disk-space one reads worst, because it is half done: lib/api.ts already wraps the backend's English sentence inside a translated one, so a German user gets a German frame around an English clause. The app also already has the answer, in two features — the backend sends a code beside its prose, and the frontend shows its own text for the code and falls back to the backend's English for a code it does not know. Everything in this gap line is prose with no code to key on.
Where
surfsense_local/frontend/src/features/chat/chat-error-text.ts— the pattern to copy, not to reinvent: a record of<feature>_error_<code>messages with the backend's own text as the fallback.license-error-text.tsis the second example.surfsense_local/backend/modules/artifacts/service.py—_availability()and_required()produce a format'sunavailable_reason.surfsense_local/backend/modules/llm/catalog/local/rows.py— thenot_runnable_reasonproperty, falling back to the literal "SurfSense cannot run this model."surfsense_local/backend/modules/llm/fit/copy.py—badge()and_refusal(), every fit verdict and its one line of why.surfsense_local/backend/modules/llm/catalog/local/install_jobs/steps.pyandinstall_jobs/jobs.py— the install step messages, including theQUEUED,CHECKING,CANCELLEDandFAILEDconstants.surfsense_local/frontend/src/lib/api.ts—responseError(), which buildsapp_api_insufficient_space_erroraround the backend's Englishdetail.message.
What done looks like
- Each of those surfaces reads in the interface language, through an id the
translateskill's key shape allows. - The backend still sends its English prose. A code the frontend has not shipped text for must keep showing something, which is what
translatedChatError()'s final fallback relies on. - Decide whether each producer gets an enum mirrored in TypeScript, the way
ChatErrorKindinsse.tsmirrorsmodules/chat/errors.pywith a "keep the two in sync" comment, or a looser string. That is yours to decide, and it is the decision this issue turns on. - The fit verdicts carry numbers. Send them raw and format them in the message with an ICU skeleton —
copy.py's_gb()currently pre-formats "13.6 GB", which no other language can re-space or re-punctuate. - It is fine to land this one producer at a time. Say in each PR which producer it closes, and delete the Known gaps line only with the last.
What not to change
This is not a docs/contracts/ change: those four documents cover the license file, scraper API auth, the export bundle and the sunset flag. The desktop API is one tree talking to itself.
How to verify
surfsense_local/backend/tests/integration/artifacts/test_routes.py already asserts on unavailable_reason, and surfsense_local/frontend/src/lib/api.test.ts on the error body. Write the failing test first on whichever producer you start with: a route test that the response carries the code, then a frontend test that the code renders its own text and an unknown code falls through to the backend's.
cd surfsense_local/backend
uv run pytest -m unit
uv run pytest -m integration
uv run ruff check .
cd ../frontend
pnpm test
Before you start
Read CONTRIBUTING.md and the localization doc, whose Backend text section states the rule this follows. Interface strings in surfsense_local follow the translate skill described in AGENTS.md — it owns the <feature>_error_<code> key shape, the tone per language and the glossary. translations/en.json is generated from the defaultMessage in the code, so never hand-edit it; run pnpm translations and commit the result with the code. Open your PR against dev, not main. Comment here to claim this.
- 主要言語
- Python
- スター
- 16.3k
- フォーク
- 1.6k
- 平均マージ
- 13時間 35分
- マージ済み PR(30日)
- 267
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MODSetter/SurfSense のほかの issue
-
Security Scan: stop flagging pinned hashes and test fixtures on release PRs対応中かも @karthikeya1220 が 2 日前に担当しました。 オープンcode quality security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MODSetter/SurfSense#2225 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Check Apple notarization credentials on dry runs and weekly対応中かも @Cedric921 が 2 日前に担当しました。 オープンdesktop
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MODSetter/SurfSense#2224 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Release workflow: keep the macOS certificate off the Windows dry-run build対応中かも @Cedric921 が 2 日前に担当しました。 オープンdesktop security
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MODSetter/SurfSense#2223 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Write the ADR for chat modes対応中かも @Cedric921 が 2 日前に担当しました。 オープンarchitecture desktop documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
MODSetter/SurfSense#2220 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
MODSetter/SurfSense の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
lidofinance/diffyscan#239 ·
メンテナーはふだん 1 日以内に返信
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsオープンarea: tools documentation good first issue ready for a contributor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eyalgolan/statecraft-israel#873 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
GET rooms API returns 500 due to nonexistent Room.is_active attribute対応中かも @Mars-60 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
nasa/harmony-autotester#341 ·