Repository navigation
feat(subtitles): select Chinese or English for Chat and Wallpaper - #239
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chat and ordinary Wallpaper subtitles already share one translator, but its output was fixed to Simplified Chinese. This adds Subtitle translation language under Settings → General → Language & captions, with Simplified Chinese and English.
The presentation runtime owns the shared preference. All existing translation providers use a per-request language snapshot. Changing the setting refreshes Chat translations and invalidates Wallpaper pretranslations; late results from the old language cannot overwrite current entries. Already visible Wallpaper captions finish their normal playback lifetime, and queued captions are translated under the new policy when playback reaches them.
The default remains
zh-CN, so existing configurations need no migration. Chat enablement, Wallpaper display mode, speech, conversation history and Slice process language remain independent. VN retains its separate translator, configuration and cache, including VN captions displayed on Wallpaper. The misleading shared-translation role description is corrected.Validation
python -m pytest -q tests/test_assistant_language.py tests/test_wallpaper_subtitle_translator.py tests/test_chat_translation_subtitle.py tests/test_subtitle_translation_cache.py tests/test_canvas_presentation.py tests/test_config_catalog.py tests/test_vn_subtitle_grouping.py— 69 passed.npm testinelectron— 525 passed; subsequently addednode --experimental-strip-types --test tests/chatTranslationLanguage.test.mjs— 1 passed.npm run buildinelectron— passed.electron scripts/smoke-startup-settings.cjs— passed, including offline persistence and the Host application policy for both target languages.python tools/smoke_builtin_handler_catalog.py— passed with models disabled.python -m ruff check ., architecture freshness checks, maintainability ratchet andgit diff --check— passed.Provider responses are synthetic; live translation quality was not evaluated. All 16 CI checks passed on commit
4df7ab75, including the Windows suite and model-less aggregate.UI comparison
Screenshots use an isolated offline profile. Its save notice reflects the absence of a running backend; connected changes apply live.