Skip to content

I18n: Standardize using t() function#1639

Merged
benjaminshafii merged 7 commits intodifferent-ai:devfrom
johnnyshields:i18n-function-cleanup
May 4, 2026
Merged

I18n: Standardize using t() function#1639
benjaminshafii merged 7 commits intodifferent-ai:devfrom
johnnyshields:i18n-function-cleanup

Conversation

@johnnyshields
Copy link
Copy Markdown
Contributor

@johnnyshields johnnyshields commented May 4, 2026

This PR does the following:

  • Clean-up all the code in the repo to consistently use the t() function as the standard way for doing translations.
  • Remove currentLocale as 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 kwarg lng: (following I18next convention)
  • Add a check to scripts/i18n-audit.mjs to check for aliases

As 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.

# 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.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, Comment, Open in v0 May 4, 2026 7:59pm

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 4, 2026

@johnnyshields is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

The following comment was made by an LLM, it may be inaccurate:

@johnnyshields johnnyshields changed the title I18n: Standardize using t() function + add I18n audit to the CI I18n: Standardize using t() function 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.
@benjaminshafii benjaminshafii merged commit c3cb3cc into different-ai:dev May 4, 2026
9 of 13 checks passed
@johnnyshields johnnyshields deleted the i18n-function-cleanup branch May 5, 2026 03:25
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.

2 participants