Conversation
- Add Paraglide.js v2 compiler-based i18n (en/ja) - Introduce src/i18n.ts as single entry point for locale init and message exports - Replace all hardcoded UI strings with m.xxx() message calls - Decouple WorkspaceNotFoundError from its message (localized at catch site) - Guard against LANG=C/POSIX crashing Intl.Locale with try/catch fallback - Add Japanese E2E tests and unit tests for non-BCP47 locales - Add paraglide:compile prerequisite to build/check/fix/typecheck scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 14c3015 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces comprehensive internationalization capabilities to the CLI tool, enabling it to display messages in English and Japanese based on the user's system locale. This significantly improves the user experience for Japanese-speaking users and enhances the tool's resilience in diverse operating environments by addressing potential locale-related issues. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive internationalization support using Paraglide.js, adding translations for English and Japanese. The changes are well-executed, including the integration of Paraglide's compilation into the build process, robust locale detection with graceful fallbacks, and replacement of hardcoded UI strings with localized messages. A notable improvement is the decoupling of WorkspaceNotFoundError from its display message, enhancing maintainability. The addition of both unit and end-to-end tests to verify the new i18n logic and localized UI is excellent. I have one minor suggestion to improve code readability and type safety in the new locale initialization logic. Overall, this is a high-quality contribution that significantly improves the user experience for Japanese users.
| const locale = locales.includes(language as Locale) | ||
| ? (language as Locale) | ||
| : baseLocale; |
There was a problem hiding this comment.
os-locale v8.0.0 returns a string synchronously, not a Promise. Verified: typeof osLocale() is "string" and osLocale() instanceof Promise is false. No change needed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ca388dbe5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@copilot fix CI error |
What
src/i18n.tsas the single entry point for locale initialization and message exportsm.xxx()message callsWorkspaceNotFoundErrorfrom its message (message-less error; localization at the catch site)locale: "ja_JP.UTF-8"to verify actual Japanese outputLANG=C/POSIXunit tests to guard againstIntl.LocaleRangeErrorin minimal Unix environmentsWhy
Users running
prwin Japanese-locale environments see English output today. Since the tool is primarily developed and used in a Japanese context, providing native Japanese output removes friction in daily use. Paraglide.js was chosen because its compiler generates JSDoc-typed JS output with zero runtime overhead, and the#paraglide/*subpath import keeps generated code out ofsrc/.The
LANG=Cguard matters because Docker containers and minimal CI images often default toLANG=C, which causesnew Intl.Locale('C')to throw aRangeError, crashing the CLI before any workspace detection runs.Ref