[PR #6889] [CLOSED] feat(i18n): add complete Slovak localization and API reference #6503

Closed
opened 2026-11-02 04:09:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6889
Author: @Vaso73
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: codex/slovak-localization


📝 Commits (6)

  • 06bd0bd test(frontend): settle deferred balancer validation timers
  • 0e37991 feat(i18n): add complete Slovak interface localization
  • 21871af test(frontend): drain subscription balancer validation timers
  • 175162f feat(i18n): localize the complete API reference in Slovak
  • d5d5187 docs(i18n): add Slovak interface previews
  • 6ea92d9 fix(i18n): preserve existing CPU labels and 2FA identity

📊 Changes

78 files changed (+15034 additions, -365 deletions)

View changed files

📝 .github/claude/issue-analyst-context.md (+4 -2)
📝 CLAUDE.md (+5 -2)
📝 CONTRIBUTING.md (+13 -2)
📝 README.md (+3 -3)
📝 REVIEW.md (+1 -1)
📝 frontend/CLAUDE.md (+2 -1)
📝 frontend/src/components/command-palette/CommandPalette.tsx (+2 -1)
📝 frontend/src/components/form/HeaderMapEditor.tsx (+4 -3)
📝 frontend/src/entries/login.tsx (+8 -5)
📝 frontend/src/entries/subpage.tsx (+8 -5)
➕ frontend/src/i18n/LocaleProvider.tsx (+14 -0)
📝 frontend/src/i18n/react.ts (+5 -0)
📝 frontend/src/lib/xray/forms/transport/CustomSockoptList.tsx (+15 -8)
📝 frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx (+249 -144)
📝 frontend/src/main.tsx (+8 -5)
📝 frontend/src/pages/api-docs/ApiDocsPage.css (+4 -0)
📝 frontend/src/pages/api-docs/ApiDocsPage.tsx (+38 -14)
➕ frontend/src/pages/api-docs/localization.ts (+68 -0)
➕ frontend/src/pages/api-docs/swagger-labels.ts (+70 -0)
📝 frontend/src/pages/clients/ClientBulkAddModal.tsx (+6 -5)

...and 58 more files

📄 Description

Summary

Add Slovak (sk-SK, Slovenčina) to the panel, login screen, subscription viewer, bot messages and complete in-panel API reference. The catalog contains 3,353 translated strings, with Slovak validation, calendar controls and decimal formatting.

Why

Slovak is currently unavailable. A catalog alone leaves several forms, validation messages and the API reference in English, so this also connects the remaining translatable labels to i18n and supplies the component locales.

  • Register sk-SK and detect browser language sk; keep panel and subscription language preferences independent.
  • Translate generated API prose and Swagger controls at the display boundary. Paths, schema constraints, authentication scopes, request values and code examples remain unchanged.
  • Add the new keys to every existing catalog using their original English text; preserve all existing translations in the other 13 locales.
  • Preserve the original CPU core labels in all 13 existing languages and the original Administrator account in the 2FA enrollment URI; regression tests cover both boundaries.
  • Document the API-translation maintenance workflow in CONTRIBUTING.md, with coverage failures naming missing and retired prose.
  • Add catalog, component, API-contract and backend-template regression tests. Two separate test-only commits settle deferred AntD balancer validation before jsdom teardown; application validation is unchanged.

Related: #6460 also wires some hardcoded UI labels into i18n. There is partial overlap in six frontend files, plus the existing catalogs; this PR is based directly on current main and does not depend on that change. No dependency updates are included.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

Subscription and statistics changes concern displayed text and number formatting. Telegram/Discord changes are localized message templates. API endpoints, protocol/configuration values, numeric calculations and traffic accounting are unchanged.

How was this tested?

  • Frontend: npm run typecheck, npm run lint, npm run format:check, npm test (1,857 tests in 194 files), npm run build, npm run build-storybook.
  • Backend: go build ./..., go test ./...; the new tests load all catalogs through the real backend parser and render Slovak bot templates with synthetic values.
  • Chromium: 24 checks against the compiled UI with mocked APIs and external requests blocked. Covered Slovak/English switching, independent subscription language, login errors, client forms, calendar, light/dark themes, mobile layout, cancel/delete behavior and API documentation, including a mocked GET request.
  • The Slovak wording was also reviewed and accepted by a Slovak-speaking user on a separate test installation.

To review manually, select Slovenčina, open Klienti → Upraviť, inspect the calendar and cancel the dialog. Check empty login validation, Dokumentácia API (operation descriptions, schemas, authorization controls and WebSocket events), and the subscription viewer; then switch back to English.

Screenshots / recordings

Compiled UI with synthetic preview data:

Client form

Slovak client form

API reference

Slovak API reference

Breaking changes

None. No migration or configuration change is required.

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6889 **Author:** [@Vaso73](https://github.com/Vaso73) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/slovak-localization` --- ### 📝 Commits (6) - [`06bd0bd`](https://github.com/MHSanaei/3x-ui/commit/06bd0bd5f4e4b6ae23fe551ada5000b10e5a1b18) test(frontend): settle deferred balancer validation timers - [`0e37991`](https://github.com/MHSanaei/3x-ui/commit/0e3799185b4260a6785a8cefd7d06fb978cc1e1d) feat(i18n): add complete Slovak interface localization - [`21871af`](https://github.com/MHSanaei/3x-ui/commit/21871afcdf3ca0bbf406d009787b1fbd1b20aefd) test(frontend): drain subscription balancer validation timers - [`175162f`](https://github.com/MHSanaei/3x-ui/commit/175162f89ffad85a17db3b2819961ea3c34c667d) feat(i18n): localize the complete API reference in Slovak - [`d5d5187`](https://github.com/MHSanaei/3x-ui/commit/d5d51872f6b010c1fcf6d677dcc776dbcb92fc26) docs(i18n): add Slovak interface previews - [`6ea92d9`](https://github.com/MHSanaei/3x-ui/commit/6ea92d954b3d6aef5b12b965c24e2613b0bdd743) fix(i18n): preserve existing CPU labels and 2FA identity ### 📊 Changes **78 files changed** (+15034 additions, -365 deletions) <details> <summary>View changed files</summary> 📝 `.github/claude/issue-analyst-context.md` (+4 -2) 📝 `CLAUDE.md` (+5 -2) 📝 `CONTRIBUTING.md` (+13 -2) 📝 `README.md` (+3 -3) 📝 `REVIEW.md` (+1 -1) 📝 `frontend/CLAUDE.md` (+2 -1) 📝 `frontend/src/components/command-palette/CommandPalette.tsx` (+2 -1) 📝 `frontend/src/components/form/HeaderMapEditor.tsx` (+4 -3) 📝 `frontend/src/entries/login.tsx` (+8 -5) 📝 `frontend/src/entries/subpage.tsx` (+8 -5) ➕ `frontend/src/i18n/LocaleProvider.tsx` (+14 -0) 📝 `frontend/src/i18n/react.ts` (+5 -0) 📝 `frontend/src/lib/xray/forms/transport/CustomSockoptList.tsx` (+15 -8) 📝 `frontend/src/lib/xray/forms/transport/FinalMaskForm.tsx` (+249 -144) 📝 `frontend/src/main.tsx` (+8 -5) 📝 `frontend/src/pages/api-docs/ApiDocsPage.css` (+4 -0) 📝 `frontend/src/pages/api-docs/ApiDocsPage.tsx` (+38 -14) ➕ `frontend/src/pages/api-docs/localization.ts` (+68 -0) ➕ `frontend/src/pages/api-docs/swagger-labels.ts` (+70 -0) 📝 `frontend/src/pages/clients/ClientBulkAddModal.tsx` (+6 -5) _...and 58 more files_ </details> ### 📄 Description ## Summary Add Slovak (`sk-SK`, **Slovenčina**) to the panel, login screen, subscription viewer, bot messages and complete in-panel API reference. The catalog contains 3,353 translated strings, with Slovak validation, calendar controls and decimal formatting. ## Why Slovak is currently unavailable. A catalog alone leaves several forms, validation messages and the API reference in English, so this also connects the remaining translatable labels to i18n and supplies the component locales. - Register `sk-SK` and detect browser language `sk`; keep panel and subscription language preferences independent. - Translate generated API prose and Swagger controls at the display boundary. Paths, schema constraints, authentication scopes, request values and code examples remain unchanged. - Add the new keys to every existing catalog using their original English text; preserve all existing translations in the other 13 locales. - Preserve the original CPU core labels in all 13 existing languages and the original `Administrator` account in the 2FA enrollment URI; regression tests cover both boundaries. - Document the API-translation maintenance workflow in `CONTRIBUTING.md`, with coverage failures naming missing and retired prose. - Add catalog, component, API-contract and backend-template regression tests. Two separate test-only commits settle deferred AntD balancer validation before jsdom teardown; application validation is unchanged. Related: #6460 also wires some hardcoded UI labels into i18n. There is partial overlap in six frontend files, plus the existing catalogs; this PR is based directly on current `main` and does not depend on that change. No dependency updates are included. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactoring (no behavior change) - [x] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [x] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [x] Subscription (share links / Clash / JSON) - [x] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [x] Telegram bot Subscription and statistics changes concern displayed text and number formatting. Telegram/Discord changes are localized message templates. API endpoints, protocol/configuration values, numeric calculations and traffic accounting are unchanged. ## How was this tested? - Frontend: `npm run typecheck`, `npm run lint`, `npm run format:check`, `npm test` (**1,857 tests in 194 files**), `npm run build`, `npm run build-storybook`. - Backend: `go build ./...`, `go test ./...`; the new tests load all catalogs through the real backend parser and render Slovak bot templates with synthetic values. - Chromium: 24 checks against the compiled UI with mocked APIs and external requests blocked. Covered Slovak/English switching, independent subscription language, login errors, client forms, calendar, light/dark themes, mobile layout, cancel/delete behavior and API documentation, including a mocked GET request. - The Slovak wording was also reviewed and accepted by a Slovak-speaking user on a separate test installation. To review manually, select **Slovenčina**, open **Klienti → Upraviť**, inspect the calendar and cancel the dialog. Check empty login validation, **Dokumentácia API** (operation descriptions, schemas, authorization controls and WebSocket events), and the subscription viewer; then switch back to English. ## Screenshots / recordings Compiled UI with synthetic preview data: ### Client form ![Slovak client form](https://raw.githubusercontent.com/Vaso73/3x-ui/d5d51872f6b010c1fcf6d677dcc776dbcb92fc26/media/slovak-client.png) ### API reference ![Slovak API reference](https://raw.githubusercontent.com/Vaso73/3x-ui/d5d51872f6b010c1fcf6d677dcc776dbcb92fc26/media/slovak-api-reference.png) ## Breaking changes None. No migration or configuration change is required. ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:09:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6503
No description provided.