Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
description: "User-visible text in new UI, and every menu and navigation label, renders through t() so it is translated into every interface language." paths: - "apps/web/src//*.tsx" - "apps/web/src//.ts" globs: "apps/web/src/**/.tsx,apps/web/src/**/*.ts" alwaysApply: false
Translate user-visible text
The app is shown in the person's interface language (their own, else their team's, else their browser's, else English). A hard-coded string stays English for everyone.
- Render user-visible text with
t('<namespace>.<key>')from@app/lib/i18n, and add the English text toapps/web/src/lib/i18n/locales/en/<namespace>.ts. This covers every menu, navigation, and command label, and all text in new UI: new components, pages, dialogs, settings, toasts, empty states, placeholders, andaria-labels. A literal label on a menu item fails CI (ast-greptsx-menu-label-translated). - Inside an existing surface that isn't translated yet (most page content, the slides, canvas, spreadsheet, and database editors), match the surface: translate all of it or none, so a page never mixes languages.
- Change only the English. The periodic translation update (the
update-translationsskill) translates new and changed messages, which show in English until then;bun run i18n:statuslists them. Translating in the same change is fine: followsrc/lib/i18n/glossary.mdand runbun run i18n:status --accept <language>for each language you finish. - Use
{{name}}placeholders for interpolated values (t('nav.goTo', { label })), never string concatenation, since word order differs by language. Pass numbers as numbers:twrites them for the interface locale (1.234in German). - A message whose wording depends on a number is plural: write the English as
{ one: 'Moved {{count}} item', other: 'Moved {{count}} items' }and callt(key, { count }); the types requirecount. Make it plural even when the English doesn't change ({ other: '{{count}} selected' }), because other languages do. Don't split one sentence into singular and plural keys chosen by the count; one plural message covers every number. - Format dates and numbers on a translated surface with
formatLocale()from@app/lib/i18n(Intl.DateTimeFormat(formatLocale(), …)), never a missing or hard-coded locale, so they match the interface language. Leave untranslated surfaces and anything sent elsewhere (emails, exports, agent prompts) on their current locale; switch a surface's dates when you translate it. - Call
twhere the label renders (JSX, a memo, a hotkeydescription: () => t(...), a getterget label() { return t(...) }in a module-level config) so it updates when the language changes. Never store a translated string in a module constant or in persisted state. - Keep ids, persistence keys, and anything compared in logic in English; only the displayed text is translated.
- Size menus so long labels (German, Finnish) and CJK text fit: give menu
content a minimum width and let it grow (
min-w-*with amax-w-*cap) rather than a fixedw-*, and keeptruncateon the label as the last resort.
Check: bun run test -- src/lib/i18n passes, and just test-i18n-browser
passes when a menu's width or a translation changed.