Repository navigation
feat(client): add Russian (ru) locale - #67
Merged
Merged
Conversation
- add src/client/i18n/ru.ts (654 keys, key set identical to zh/en) - widen LocaleId to 'zh' | 'en' | 'ru', register the dictionary and accept ru in isLocaleId() and in the <html lang> / navigator fallback - built-in templates keep the English bodies for ru (templateLocale()) - cover trilingual parity, non-empty values, enum maps, ru detection, placeholder substitution, template fallback and the source scan - changelog entry under Unreleased Tested: npx vitest run (44 files, 585 tests), npx tsc --noEmit (clean), npm run build:client.
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.
What
Adds a native Russian (
ru) locale to the task board UI.src/client/i18n/ru.tscarries the same 654 keys asen.ts/zh.tsand is typed asTaskboardDict, so the existing parity test keeps every dictionary in sync.Why native, not a DOM-patching pack
Until now Russian came only from an external translation pack that rewrites text nodes at runtime by matching English strings (
DOM_EN_TEXT+TreeWalker). That approach breaks on new copy, misses attributes and cannot translate placeholders. A first-class dictionary is checked by the type system and by the unit tests.Changes
src/client/i18n/ru.tsexport const ru: TaskboardDictsrc/client/i18n/runtime.tsLocaleId = 'zh' | 'en' | 'ru',DICTS = { zh, en, ru },isLocaleId,rubranches indetectFallbackLocale()(<html lang>+navigator.languages)src/client/i18n/templates.tstemplateLocale()narrows the locale to'zh' | 'en'; built-in template bodies stay English forru(BuiltinTemplateLocaleis not widened)tests/i18n.spec.tsruresolution via<html lang="ru-RU">, placeholder substitution, template fallbackchangelog.mdUnreleasedentryActivation note
The core locale service (
@deepseek-ai/dsh-client-locale) accepts arbitrary string locale ids (LocaleId = string) but only exposes languages that have been registered. The dictionary here is ready to use; a language-pack plugin registers the entry point with:Without that registration the stored preference resolves back to the provisional locale, so this PR is safe to merge on its own and does not change behaviour for
zh/enusers.Verification
npx vitest run tests/i18n.spec.ts→ 21 passednpx vitest run→ 44 files / 585 tests passednpx tsc --noEmit→ exit 0npm run build:client→lib/client.js396.66 kB (gzip 99.80 kB)Terminology (reviewed by a native Russian speaker)
worktree→ «рабочее дерево» (paths such as.dsh-worktreesand the shell commandgit worktree removeare left untouched)claim/release a claim→ «взятие в работу» / «отменить взятие в работу»Acceptance checklist (DoD)→ «Чек-лист приёмки (DoD)»Reasoning effort→ «Уровень рассуждений»Needs Human→ «Требуется человек»; theWaiting for Mefilter reads «Ждут меня»Todo→ «К выполнению» (never «очередь»)unlinked→ «непривязанный»,uncommitted changes→ «незакоммиченные изменения»Notes
ru.tsthat contradictsen.ts; placeholders, emoji,\nescapes and{{lastExecution}}/{{lastComments}}markers are preserved verbatim.task.id, only the search box matches it — showing it in the detail panel would be a separate change.