fix(i18n): use UI locale for latest blog content#1207
Conversation
π¦ Changeset detectedLatest commit: 47307ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Documentation Updates 1 document(s) were updated by changes in this PR: Internationalization and LocalizationView Changes@@ -808,6 +808,13 @@
This footer component replaced the previous "What's New" entry in the product navigation section, providing a richer preview experience with inline blog content and video embeds.
+**Blog Locale Resolution:**
+Blog content is locale-aware and automatically fetched based on the user's UI language. The extension detects the UI locale using `getBlogLocaleFromUILanguage()`, which maps UI locales to blog API locales:
+- Chinese locales (those starting with "zh", like zh-CN, zh-TW) map to "zh"
+- All other locales default to "en"
+
+This locale resolution is performed by `resolveBlogLocale()`, which normalizes the UI locale and returns either "en" or "zh" as the blog locale. The resolution applies to both the popup blog notification component and the What's New footer in the options sidebar, ensuring users see blog content in their preferred language when available.
+
### Blog System Localization
The website's blog system uses the `blog` namespace in locale files for all blog-related UI strings, including titles, descriptions, navigation, author/date labels, sharing, and minimum extension version requirements. To add or update blog UI strings, add new keys under `blog` in each locale file.
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0655949b65
βΉοΈ About Codex in GitHub
Codex has been enabled to automatically 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 π.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
1 issue found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid β if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/entrypoints/popup/components/__tests__/blog-notification.test.tsx">
<violation number="1" location="src/entrypoints/popup/components/__tests__/blog-notification.test.tsx:111">
P3: The test hardcodes the extension version, so it will break every time `package.json` version changes. Import or mock the version so the test tracks the real value.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Type of Changes
Description
This PR bundles two small bug fixes:
For the blog fix, this change adds a blog-specific locale resolver that maps Chinese UI locales such as
zh-CNandzh-TWto the blog API's supportedzhlocale and falls back unsupported locales toen.The options sidebar "What's new" popover and the popup blog notification now use the resolved UI locale when requesting the latest blog post. Tests were added to cover locale mapping and to verify both UI entry points pass the resolved locale through to
getLatestBlogDate.Related Issue
Closes #
How Has This Been Tested?
Commands run:
pnpm exec vitest run src/utils/__tests__/blog.test.ts src/entrypoints/options/app-sidebar/__tests__/whats-new-footer.test.tsx src/entrypoints/popup/components/__tests__/blog-notification.test.tsxpnpm exec tsc --noEmitgit push -u origin fix/blog-locale(remote hook ran repolint,type-check, and fulltest)Screenshots
Checklist
Additional Information
fix(i18n): use the UI locale for latest blog contentfix(config-sync): widen the Google Drive conflict resolution dialog for large config diffs