Translations (i18n)

Translations (i18n)

WeWorks supports multiple UI languages in the client and landing apps.

Supported languages

CodeLanguage
enEnglish
zh-CNSimplified Chinese (简体中文)
zh-TWTraditional Chinese (繁體中文)
koKorean (한국어)

Users switch language from the sidebar Language picker or profile settings. The choice is stored in a cookie (NEXT_LOCALE) and optionally on the user profile.

File locations

Client — primary app strings:

apps/client/locales/
├── en/weworks.json
├── zh-CN/weworks.json
├── zh-TW/weworks.json
└── ko/weworks.json

Landing — public site strings (similar structure under apps/landing/locales/).

Configuration

Client locale list is defined in apps/client/i18n.js:

module.exports = {
  locales: ["en", "zh-CN", "zh-TW", "ko"],
  defaultLocale: "en",
  pages: { "*": ["weworks"] },
};

Runtime locale resolution uses apps/client/lib/appLocale.ts and cookie-based switching (no URL locale prefix required).

Adding a new language

1. Create translation files

mkdir -p apps/client/locales/ja
cp apps/client/locales/en/weworks.json apps/client/locales/ja/weworks.json
# Translate strings in ja/weworks.json

Repeat for apps/landing/locales/ if the landing site needs the language.

2. Register the locale

In apps/client/i18n.js:

locales: ["en", "zh-CN", "zh-TW", "ko", "ja"],

3. Add to language picker

Update apps/client/components/LanguageSelector/index.tsx:

const languages = [
  // …existing…
  { value: "ja", label: "日本語" },
];

Also update any admin user-creation forms that list languages (admin/users/internal/new.tsx, profile page).

4. Test

yarn dev --filter=client --filter=api

Open http://localhost:3001, switch language from the sidebar, and verify strings load.

Translation keys

Strings are grouped by feature in weworks.json, for example:

  • create_ticket_modal.* — task creation form
  • dashboard.* — owner dashboard
  • task_list.* — open/closed lists
  • hardware_shop.* — hardware shop
  • command_menu.* — command palette search

When adding UI text in the client, add keys to all locale files (or at minimum en plus any language you support).

Docs site

This documentation site (apps/docs) is English-only for now. Nextra i18n can be enabled in theme.config.jsx if needed later.