Skip to content

feat: add Spanish localization and language-aware prompts - #728

Open
Dragost wants to merge 4 commits into
HKUDS:devfrom
Dragost:feat/spanish-localization
Open

feat: add Spanish localization and language-aware prompts#728
Dragost wants to merge 4 commits into
HKUDS:devfrom
Dragost:feat/spanish-localization

Conversation

@Dragost

@Dragost Dragost commented Jul 30, 2026

Copy link
Copy Markdown

Description

Adds Spanish (Spain) as a first-class DeepTutor locale across the backend, web interface, and model-facing prompts.

  • Introduces extensible backend and frontend language registries.
  • Adds es / es-ES to the language selector and a complete Spanish UI catalog.
  • Separates the interface language from the default model response language, with backward-compatible migration.
  • Localizes backend status messages, metadata, quiz-judging prompts, MCP services, CLI apps, and context-budget UI.
  • Preserves the selected response language across agent and model calls, explicitly requesting Spanish from Spain.
  • Adds locale key/placeholder parity and Spanish translation-quality regression tests.

Related work

Includes the UI/model language separation proposed in #758, adapted to this Spanish-localization branch. The corresponding commit retains its author as co-author.

Module(s) Affected

  • agents
  • api
  • config
  • core
  • services
  • tools
  • utils
  • web (Frontend)
  • scripts
  • tests

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project coding standards.
  • I have run all pre-commit hooks on the files changed by this PR and fixed any issues.
  • I have added relevant tests for my changes.
  • Documentation updates are not necessary for this change.
  • My changes do not introduce any new security vulnerabilities.

Validation

  • Targeted backend localization/settings/prompt tests: 64 passed (2 warnings).
  • Web Node tests: 578 passed, 0 failed.
  • All pre-commit hooks passed on the 45 files changed by this PR.
  • Spanish/English app-catalog key and placeholder parity passed: 3,240 / 3,240 keys (plus 7 / 7 common keys).
  • ESLint passed with 0 errors (56 warnings outside the scope of this PR remain).
  • Next.js production build and TypeScript passed; all 59 static pages were generated.
  • git diff --check passed.

Additional Notes

The branch is rebased onto current dev commit 1f4de01e and now includes the newly internationalized Whisper surface. The Spanish catalog covers 169 newly introduced upstream strings in total, including the latest 29 Whisper strings, and remains at exact parity with English.

New capability prompts continue through the shared strict response-language directive, so Spanish model responses remain enforced independently from the interface language without duplicating the technical prompt trees.

The three commits intentionally separate backend locale infrastructure, the web locale/catalog, and response-language propagation through model prompts. The Spanish catalog uses Spain-specific terminology and a consistent informal voice.

@Dragost
Dragost force-pushed the feat/spanish-localization branch from 2680bc8 to 34dec71 Compare August 2, 2026 16:55
@Dragost

Dragost commented Aug 2, 2026

Copy link
Copy Markdown
Author

Rebased this PR onto the current dev branch and completed the Spanish coverage for the newly added MCP services, CLI apps, and context-budget UI (145 frontend strings and 16 backend messages). I also wired locale key/placeholder parity into the Web Node test command.

Validation after the rebase: 369 Web Node tests passed, TypeScript passed, 3,560 Python tests passed (7 skipped), Ruff passed, and all project pre-commit hooks passed on the changed files.

@Dragost
Dragost force-pushed the feat/spanish-localization branch 3 times, most recently from 50a812e to a7cfea4 Compare August 11, 2026 11:25
@Christian-B-Koller

Copy link
Copy Markdown

I am waiting for your changes to be integrated into main. I have done a German language translation with every text on an older version of DeepTutor. I I'll wait until #728 lands and then move my translation over to the architecture and code that is prepared here.

@ting-hong-shieh

Copy link
Copy Markdown
Contributor

Hi @Dragost — I noticed that GitHub currently marks this PR as conflicting with the latest dev branch. I’m working on zh-TW support that would build on the language registries introduced here, so I’d be happy to help with the rebase conflicts if that would be useful.

I can reproduce the rebase against the current HKUDS/dev, run the relevant Web and backend i18n tests, and provide either a cherry-pickable commit or a PR to your fork—whichever you prefer. I won’t make changes until you confirm, to avoid duplicating work if you’re already handling it.

@Dragost
Dragost force-pushed the feat/spanish-localization branch 2 times, most recently from 5cdf88e to e29d74f Compare August 13, 2026 06:11
@Dragost

Dragost commented Aug 13, 2026

Copy link
Copy Markdown
Author

Thanks, @Christian-B-Koller, and thank you as well, @ting-hong-shieh, for offering to help.

I’ve now rebased #728 onto the latest dev, resolved the conflicts, and updated the Spanish catalog with the new CodeBuddy, model synchronization, and Codex reasoning strings introduced upstream. The PR is conflict-free and fully up to date now, so no additional cherry-pick or PR is needed at the moment.

We’re currently waiting for a maintainer to review it and authorize the fork workflow. Once merged, the language registries and the separation between interface and model-response languages should provide a clean base for both the German and zh-TW translations.

Thanks again to both of you for your work and willingness to contribute!

@Dragost

Dragost commented Aug 18, 2026

Copy link
Copy Markdown
Author

Update: this PR has now been rebased onto current dev (96d6df9e, v1.5.13) and is conflict-free/mergeable again.

The BookCreator conflict was resolved while preserving the expanded upstream book-language selector. I also synchronized the Spanish catalog with the current English source: 121 new strings were translated and 3 obsolete provider-specific keys were removed. This covers the new starter suggestions, Tencent IMA, GraphRAG compatibility, and book generation/reading flows.

Current validation: 62 targeted backend tests passed, 455 Web Node tests passed, all pre-commit hooks pass on the 45 PR files, ESLint reports 0 errors, the Next.js production build and TypeScript pass, and i18n key/placeholder parity is clean. The history remains split into the original three focused commits.

Ready for maintainer review. Thanks again to everyone coordinating downstream locale work around this foundation.

@Christian-B-Koller

Copy link
Copy Markdown

Thank you very much @Dragost for your work, I am looking forward to the approval of the maintainer.

@Dragost
Dragost force-pushed the feat/spanish-localization branch from 5311f06 to b0ef110 Compare August 19, 2026 17:49
@Dragost

Dragost commented Aug 19, 2026

Copy link
Copy Markdown
Author

Update: I’ve rebased this PR onto current dev (4a68ccea, v1.5.14) and resolved the new conflicts while preserving the latest upstream behavior.

The Spanish catalog now covers the newly introduced notebooks, immersive reading, question bank, IMA, and indexing surfaces. This adds 140 new upstream strings and restores exact English/Spanish parity at 3,211 keys. I also verified that the new capability prompts pass through the shared strict response-language directive, so Spanish model replies remain enforced independently from the UI language.

Current validation: 64 targeted backend tests and 574 Web Node tests pass; all pre-commit hooks pass on the 45 changed files; ESLint reports 0 errors; and the Next.js production build, TypeScript, and all 59 static pages complete successfully. The history remains split into the same three focused commits.

Thanks again, @Christian-B-Koller, for coordinating the German translation, and @ting-hong-shieh for the zh-TW work and offer to help. We’re ready and waiting for maintainer review.

@Dragost
Dragost force-pushed the feat/spanish-localization branch from b0ef110 to 78bd1ea Compare August 19, 2026 17:55
@Dragost

Dragost commented Aug 19, 2026

Copy link
Copy Markdown
Author

Follow-up: dev moved again while this update was in progress, so the PR is now also rebased onto 1f4de01e.

The newly internationalized Whisper surface is translated into Spanish (29 additional strings), bringing the app catalog to exact EN/ES parity at 3,240 / 3,240 keys. Validation is current: 578 Web tests passed, all pre-commit hooks passed across the 45 changed files, ESLint reports 0 errors, and the production build generated all 59 pages.

The branch still contains exactly three focused commits and GitHub reports it as mergeable without conflicts. The remaining action_required workflow state requires maintainer approval for CI on this fork PR.

@ting-hong-shieh

Copy link
Copy Markdown
Contributor

Got it! Thanks!

@Dragost

Dragost commented Aug 19, 2026

Copy link
Copy Markdown
Author

Updated the language controls to scalable dropdowns so adding more locales (such as German or zh-TW) no longer expands the settings row horizontally. The interface and model-response preferences remain independent, and each option uses its native language name. The controls are native select elements for keyboard, screen-reader, and mobile support.

Screenshot with the Glass theme enabled (Spanish interface and Spanish model responses):

DeepTutor language selectors with the Glass theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants