AS IS
All user-facing strings are hardcoded in English throughout the codebase:
- UI prompts:
"Select package", "Select script" (src/ui.ts)
- Cancellation message:
"Cancelled." (src/ui.ts)
- Error messages:
"No packages match: ...", "Multiple packages match: ...", "No scripts in ..." (src/index.ts)
- Workspace error:
"Run prw from workspace root." (src/workspace.ts)
Japanese-speaking users see English-only output with no way to change it.
TO BE
Detect locale from the environment (via `LANG` / `LC_ALL` env vars or `Intl.DateTimeFormat().resolvedOptions().locale`) and display messages in the matching language. Fall back to English if the locale is not supported.
Supported locales in v1:
en (English) — default/fallback
ja (Japanese)
Example (Japanese locale):
```
パッケージを選択:
❯ @myapp/web apps/web
@myapp/api apps/api
スクリプトを選択:
❯ dev next dev
build tsc && next build
```
Implementation notes:
- Introduce a
src/i18n.ts module exporting a typed message catalog and a `t(key)` helper
- All hardcoded strings in `ui.ts`, `index.ts`, and `workspace.ts` replaced with `t()` calls
- The active locale is resolved once at startup and passed down (or stored as a module-level singleton)
- No runtime dependencies required — plain object lookup is sufficient
AS IS
All user-facing strings are hardcoded in English throughout the codebase:
"Select package","Select script"(src/ui.ts)"Cancelled."(src/ui.ts)"No packages match: ...","Multiple packages match: ...","No scripts in ..."(src/index.ts)"Run prw from workspace root."(src/workspace.ts)Japanese-speaking users see English-only output with no way to change it.
TO BE
Detect locale from the environment (via `LANG` / `LC_ALL` env vars or `Intl.DateTimeFormat().resolvedOptions().locale`) and display messages in the matching language. Fall back to English if the locale is not supported.
Supported locales in v1:
en(English) — default/fallbackja(Japanese)Example (Japanese locale):
```
パッケージを選択:
❯ @myapp/web apps/web
@myapp/api apps/api
スクリプトを選択:
❯ dev next dev
build tsc && next build
```
Implementation notes:
src/i18n.tsmodule exporting a typed message catalog and a `t(key)` helper