I18n: Standardize using t() function#1639
Merged
benjaminshafii merged 7 commits intodifferent-ai:devfrom May 4, 2026
Merged
Conversation
# Conflicts: # apps/app/src/app/app-settings/authorized-folders-panel.tsx # apps/app/src/app/app.tsx # apps/app/src/app/bundles/skill-destination-modal.tsx # apps/app/src/app/bundles/store.ts # apps/app/src/app/components/add-mcp-modal.tsx # apps/app/src/app/components/control-chrome-setup-modal.tsx # apps/app/src/app/components/den-settings-panel.tsx # apps/app/src/app/components/mcp-auth-modal.tsx # apps/app/src/app/components/model-picker-modal.tsx # apps/app/src/app/components/question-modal.tsx # apps/app/src/app/components/rename-session-modal.tsx # apps/app/src/app/components/rename-workspace-modal.tsx # apps/app/src/app/components/reset-modal.tsx # apps/app/src/app/components/session/composer.tsx # apps/app/src/app/components/session/message-list.tsx # apps/app/src/app/components/session/workspace-session-list.tsx # apps/app/src/app/components/status-bar.tsx # apps/app/src/app/connections/openwork-server-store.ts # apps/app/src/app/connections/store.ts # apps/app/src/app/context/extensions.ts # apps/app/src/app/context/global-sync.tsx # apps/app/src/app/context/model-config.ts # apps/app/src/app/context/session.ts # apps/app/src/app/context/workspace.ts # apps/app/src/app/pages/automations.tsx # apps/app/src/app/pages/extensions.tsx # apps/app/src/app/pages/identities.tsx # apps/app/src/app/pages/mcp.tsx # apps/app/src/app/pages/session.tsx # apps/app/src/app/pages/settings.tsx # apps/app/src/app/pages/skills.tsx # apps/app/src/app/session/share-workspace.ts # apps/app/src/app/shell/deep-links.ts # apps/app/src/app/shell/settings-shell.tsx # apps/app/src/app/workspace/create-remote-workspace-modal.tsx # apps/app/src/app/workspace/create-workspace-modal.tsx # apps/app/src/react-app/domains/session/sync/actions-store.ts # apps/app/src/react/session/session-surface.react.tsx # apps/app/src/react/session/session-sync.ts
Drop translate/tr alias wrappers that just forwarded to t() with an explicit locale arg, and migrate direct t(key, locale, ...) calls to the new t(key, params?) signature. Also drop the now-unused language prop drilled through McpAuthModal, AddMcpModal, ControlChromeSetupModal, and the translate prop drilled through CreateWorkspaceLocalPanel — components read the global locale via t() directly. Default the i18n-audit script to include --aliases.
The translate() → t() rename left multi-line wrappers around short string literals. Re-flow them since the longer translate() name is gone.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@johnnyshields is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
This was referenced May 4, 2026
# Conflicts: # apps/app/src/react-app/domains/settings/panels/den-settings-panel.tsx # apps/app/src/react-app/domains/settings/state/extensions-store.ts
Dev's redesign reintroduced tr/tx wrappers via a centralized useTranslate
hook, but the hook calls t(key, currentLocale(), params) — the old
3-argument signature. The current 2-argument t(key, params) silently
drops the third arg, so every tx() call would lose its substitutions
(e.g. {name}/{count} placeholders never get replaced).
Drop currentLocale() — t() uses the current locale by default — and pass
params straight through.
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.
This PR does the following:
t()function as the standard way for doing translations.currentLocaleas an explicit second argument to the t() function; it can be used implicitly or if you really need to override it, pass-in as the kwarglng:(following I18next convention)scripts/i18n-audit.mjsto check for aliasesAs far as I can tell, the messy alias functions seem to be purely an artifact that was done somewhere originally then copied N number of times by AI to each subsequent file that was made.
Doing this standardization will enable implementing subsequent I18n features/logic (such as pluralization) and consistency/audit checks cleanly.