Skip to content

feat: add i18n#6596

Open
gengafdafd wants to merge 3 commits into
keephq:mainfrom
gengafdafd:main-i18n
Open

feat: add i18n#6596
gengafdafd wants to merge 3 commits into
keephq:mainfrom
gengafdafd:main-i18n

Conversation

@gengafdafd

Copy link
Copy Markdown

Description

This PR adds internationalization (i18n) support to Keep UI using next-intl. The implementation includes:

Core Infrastructure

  • Added next-intl library for i18n support
  • Created i18n configuration with locale detection via cookies and browser Accept-Language header
  • Implemented IntlProvider wrapper for client components
  • Added type-safe useAppTranslations hook

Translation Files

  • Created comprehensive English (en/index.json) and Chinese (zh/index.json) translation files
  • 1,386 translation keys covering all major modules
  • Organized by namespace: common, nav, auth, alerts, incidents, workflows, dashboard, settings, providers, topology, extraction, deduplication, mapping, maintenance

Components Updated (~90 files)

  • Navbar: All navigation links, search, user info, dashboard links
  • Alerts: Menu, change status, dismiss, note, simulate, enrich, assign ticket, associate incident, error events, column selection
  • Incidents: Header, overview, tabs, create/link tickets, merge, report
  • Workflows: Editor, triggers, status, manual run, test run, upload/create modals
  • Settings: Users, groups, roles, permissions, API keys, webhook, SMTP
  • Providers: Form, tiles, search, filter
  • Topology: Map, add/edit node, applications
  • Other: Extraction, deduplication, mapping, maintenance

Language Switching

  • Added language settings page in Settings zh Language
  • Supports English and Chinese with cookie persistence
  • Automatic locale detection from browser

Bug Fixes

  • Fixed HTML nesting errors (<p> containing <div>, <button> nesting)
  • Fixed react-select hydration issues

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

  • Default language is Chinese (zh)
  • Language preference is stored in NEXT_LOCALE cookie
  • Adding new languages only requires creating a new JSON file in i18n/messages/

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Documentation Improvements or additions to documentation Enhancement New feature or request javascript Pull requests that update Javascript code labels Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

No linked issues found. Please add the corresponding issues in the pull request description.
Use GitHub automation to close the issue when a PR is merged

@github-actions

Copy link
Copy Markdown
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "feat: add i18n". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

Documentation Improvements or additions to documentation Enhancement New feature or request javascript Pull requests that update Javascript code size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants