Skip to content

feat: translate the popup and store name into 7 languages - #51

Merged
spin311 merged 14 commits into
masterfrom
feat/i18n
Nov 14, 2026
Merged

spin311 merged 14 commits into
masterfrom
feat/i18n

Conversation

@spin311

@spin311 spin311 commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Every user-visible popup string now comes from public/_locales/en/messages.json through a typed t() over browser.i18n. The manifest name, description and popup title use __MSG_ (default_locale: en).
  • Adds 7 catalogues: zh_CN, zh_TW, pt_BR, es, es_419, fr, vi. They were picked from the Chrome dashboard's users/installs by language (15 Oct to 12 Nov 2026): about 36% of weekly users browse in these languages; Chinese (China) alone is 19%.
  • The English summary changes (commit 69021e6) from "Script that gives you maximum amount of microsoft rewards points…" to "Runs your daily Bing searches for Microsoft Rewards automatically or with one click." It describes what the extension does, and every translation says the same.
  • No translated name contains Microsoft or Bing. Chinese uses 自动搜索奖励 / 自動搜尋獎勵; the other languages keep "Search automatic rewards". Vietnamese keeps Microsoft's English terms (Daily set, Member/Silver/Gold, Ready to claim), because Microsoft Rewards has no Vietnamese version.
  • Plural rules and <html lang> follow the catalogue actually served.
  • Popup text wraps instead of clipping: header, promo tiles, card buttons, footer, the account-level select, and info tips that ran off the left edge (English "Daily set" already did on master).

Which language users get

  • Popup: the browser's UI language, falling back to English. Chrome: es-MX → es_419 → es, pt-PT → en. Firefox: es-AR → es, pt-PT → pt_BR.
  • es_419: a copy of es, so Latin American visitors get a Spanish Chrome Web Store listing (the store has no es-419 → es fallback).
  • Existing users whose browser is in one of these languages will see the popup, and the extension's name on chrome://extensions, in that language after updating.

Test plan

  • npm test: 238 tests pass in 19 files; npm run compile clean; npm run build and build:firefox pass
  • English unchanged against master in 11 popup states, apart from the "Daily set" tip fix
  • Real Chrome for Testing 157 and Firefox 160 stable, with the UI language chosen by the browser, all locales: no clipping; $$ renders as $
  • Independent code review (one medium finding about plural rules, fixed); translation review against Microsoft Rewards' localized terms (fixes applied)
  • Native-speaker check of zh_CN, pt_BR and es; confirm the French "Daily set" term on a signed-in French dashboard
  • Load the unpacked build in your own Chrome and Firefox and click through once
  • After upload, paste the localized detailed descriptions in the Chrome dashboard (every locale, es and es_419 included) and on Firefox

Size

  • Chrome zip: 196,331 → 214,065 bytes (+9%), almost all _locales.

Notes

  • search.test.ts "keeps the configured timeout as the average" fails about 1 run in 8. It does on master too, so it isn't caused by this branch.
  • No images were added or changed. Version not bumped here.

public/_locales/en/messages.json holds every user-visible string, each with a
description for translators (where it shows, length limits, what to keep in
English). The manifest declares en as default_locale and reads its name,
description and toolbar title from the catalogue, with the same English text.
t(key, substitutions?) reads a message through the browser's i18n; MessageKey
comes from the English catalogue, so an unknown key does not compile.
tPlural(key, count) picks the _one or _other message with Intl.PluralRules for
the browser's UI language, which uiLocale() exposes.

WXT's fake browser throws on every i18n call, so a shared test setup answers
getMessage from the English catalogue with the browsers' placeholder rules and
reports an en-US UI language.
Loops over public/_locales/*/messages.json: each locale must have exactly the
English message names, the same placeholders per message, every used
placeholder defined, literal dollar signs written as $$, extName within 45
characters (addons.mozilla.org) and extDescription within 132 (Chrome Web
Store). The English catalogue must also use Chrome-valid names, no two names
that differ only in case, and a description on every message. With English
only, the cross-locale checks pass trivially.
Every popup label, heading, button, tooltip, info tip, aria-label, alt text,
card text and footer link now goes through t(), with the same English text.

- Sentences that embed a value keep it inside one message as a named
  placeholder: the suggested gap, the run count, the extension's name in the
  review card, and the Get rewards label quoted in the Daily searches tip.
- The sponsor card's bold run count and the progress bar's screen-reader label
  use tPlural, so translations can vary the noun with the number.
- Brand names stay out of translation: the cross-promo label passes "Free Game
  Claimer" in as a placeholder, and the GitHub footer link stays literal.
- The popup's document title is set from extName, since index.html can't read
  the catalogue.
The "New" badge set on update comes from updateBadge, whose description caps
translations at 4 characters (the badge cuts off the rest).
Each catalogue names its own language in localeTag (en here), and the popup
sets <html lang> from it, so screen readers, hyphenation and font choice follow
the language actually shown, including the English fallback. The parity test
checks that localeTag is the BCP 47 form of the catalogue's folder (pt_BR ->
pt-BR).
Checked in Chromium with the es, fr, pt_BR, vi, zh_CN and zh_TW catalogues.
English renders exactly as before, except one info tip that master already
pushed 14px off the popup.

- Header title, promo tile text: wrap instead of nowrap.
- Prompt-card actions and footer: flex-wrap, so a long button, link or footer
  label moves to a second line rather than out of the card.
- Account level list: at least 88px, wider when a level name needs it.
- Info tips: positioned against the row label so they stay centred on the "i"
  but never start left of the card's edge; short labels (Daily set in English,
  most rows in Chinese) used to push them off the popup.
Languages picked from the Chrome dashboard's users-by-language export
(15 Oct - 12 Nov 2026): together about 36% of weekly users. Draft
translations; a native-speaker check is still due for zh_CN, pt_BR, es.
tPlural chose _one/_other with the browser's UI language, but the text comes
from whichever catalogue the browser served. A UI language without a catalogue
(Russian, Ukrainian, Croatian...) gets English text, and Russian rules call 31
"one", so the sponsor card read "31 search run done for you". The rules now
come from the served catalogue's localeTag.
Microsoft Rewards' own terms per language (准备领取, 準備領取, Prêt à
réclamer, English terms for vi where Rewards has no Vietnamese); the daily
set is clicked, not completed; shorter tooltips for pt_BR and es.
The old summary promised the maximum amount of points; the extension runs
the daily Bing searches. The translations already say this.
The Chrome Web Store shows a listing only for the visitor's exact store
locale: Latin American visitors (es-419) get English unless es_419 exists.
The popup already fell back es_419 -> es; this is for the store listing.
spin311 added a commit that referenced this pull request Nov 14, 2026
Adds store-assets/ with capture and render tools for the Chrome Web Store screenshots (1-main, 2-progress, 3-settings) in en, zh_CN, zh_TW, pt_BR, es, es_419, fr and vi. Guards stop rendering on Microsoft or Bing marks in captions or the browser frame, and capture on unexpected images in the popup. Commits the 24 images uploaded to the dashboard. Localized captures need the i18n build (#51).
@spin311
spin311 merged commit 192f212 into master Nov 14, 2026
2 checks passed
@spin311
spin311 deleted the feat/i18n branch November 14, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant