Skip to content

fix(i18n): use UI locale for latest blog content#1207

Merged
mengxi-ream merged 2 commits intomainfrom
fix/blog-locale
Mar 23, 2026
Merged

fix(i18n): use UI locale for latest blog content#1207
mengxi-ream merged 2 commits intomainfrom
fix/blog-locale

Conversation

@ananaBMaster
Copy link
Copy Markdown
Collaborator

@ananaBMaster ananaBMaster commented Mar 23, 2026

Type of Changes

  • πŸ› Bug fix (fix)
  • ✨ New feature (feat)
  • πŸ“ Documentation change (docs)
  • πŸ’„ UI/style change (style)
  • ♻️ Code refactoring (refactor)
  • ⚑ Performance improvement (perf)
  • βœ… Test related (test)
  • 🌐 Internationalization (i18n)
  • πŸ”§ Build or dependencies update (build)
  • πŸ”„ CI/CD related (ci)
  • 🧠 AI model related (ai)
  • πŸ”„ Revert a previous commit (revert)
  • πŸ“¦ Other changes that do not modify src or test files (chore)

Description

This PR bundles two small bug fixes:

  1. Fix the "What's new" blog surfaces so they stop hardcoding English blog content.
  2. Widen the Google Drive config sync conflict resolution dialog so large diffs are easier to read.

For the blog fix, this change adds a blog-specific locale resolver that maps Chinese UI locales such as zh-CN and zh-TW to the blog API's supported zh locale and falls back unsupported locales to en.

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?

  • Added unit tests
  • Verified through manual testing

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.tsx
  • pnpm exec tsc --noEmit
  • git push -u origin fix/blog-locale (remote hook ran repo lint, type-check, and full test)

Screenshots

Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly if necessary
  • My code follows the code style of this project
  • My changes do not break existing functionality
  • If my code was generated by AI, I have proofread and improved it as necessary.

Additional Information

  • Added patch changesets for both fixes:
    fix(i18n): use the UI locale for latest blog content
    fix(config-sync): widen the Google Drive conflict resolution dialog for large config diffs

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 23, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 23, 2026

πŸ¦‹ Changeset detected

Latest commit: 47307ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@read-frog/extension Patch

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

@github-actions github-actions bot added the fix label Mar 23, 2026
@dosubot dosubot bot added the app: browser extension Related to browser extension label Mar 23, 2026
@dosubot
Copy link
Copy Markdown

dosubot bot commented Mar 23, 2026

Documentation Updates

1 document(s) were updated by changes in this PR:

Internationalization and Localization
View 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.
 

How did I do? Any feedback?Β Β Join Discord

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ 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".

Comment thread src/entrypoints/options/app-sidebar/whats-new-footer.tsx
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 23, 2026
@mengxi-ream mengxi-ream merged commit 8df06c3 into main Mar 23, 2026
10 checks passed
@mengxi-ream mengxi-ream deleted the fix/blog-locale branch March 23, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: browser extension Related to browser extension fix lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants