Skip to content

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

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

feat: add Spanish localization and language-aware prompts#728
Dragost wants to merge 3 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: 62 passed (2 warnings).
  • Web Node tests: 455 passed, 0 failed.
  • All pre-commit hooks passed on the 45 files changed by this PR.
  • The repository-wide pre-commit run --all-files was also checked: every hook except Prettier passed; Prettier only attempted to reformat 41 files already present on the base branch and not touched by this PR. No unrelated formatting changes were included.
  • i18n catalog key and placeholder parity passed.
  • ESLint passed with 0 errors (56 existing warnings remain).
  • Next.js production build and TypeScript passed; all 58 static pages were generated.
  • git diff --check passed.

Additional Notes

The branch is rebased onto current dev commit 96d6df9e (v1.5.13), is conflict-free, and GitHub reports it as mergeable. The Spanish catalog now covers the latest upstream starter suggestions, Tencent IMA, GraphRAG compatibility, and book generation/reading flows.

The three commits intentionally separate backend locale infrastructure, the web locale/catalog, and response-language propagation through model prompts. The rebase preserves the expanded upstream book-language selector while keeping interface language and model response language independently configurable. 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 force-pushed the feat/spanish-localization branch from e29d74f to 5311f06 Compare August 18, 2026 10:00
@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.

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