wxt-dev / wxt-dev/wxt

browser.i18n.getMessage does not work on Safari extension:

Open
#1,400 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending-triage
Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I am building an extension MV3 supports multiple languages with WXT ^0.19.26,
it works well on Edge Chrome, but not Safari.

Reproduction

Archive.zip

Steps to reproduce
  1. create a wxt-demo

  2. add a demo options page calling browser.i18n.getMessage

const _ = browser.i18n.getMessage;
...
<h1>{_("Options")}</h1>

create message files public/_locales/{en,zh_TW}/messages.json

  1. build chrome extension pnpm i && pnpm build

  2. generate safari extension

xcrun safari-web-extension-converter \
--project-location . \
--app-name WXTDemo \
--bundle-identifier info.wxt.demo \
--objc \
--macos-only \
--no-prompt \
--no-open \
--force \
.output/chrome-mv3
  1. build safari extension with Xcode

  2. Launch Safari and load the un-sign extension WXTDemo

open Options page,
WANT <h1>{_("Options")}</h1> => <h1>Options</h1> ,
GOT <h1></h1> .

System Info
System:
    OS: macOS 14
  Binaries:
    Node: 23.3.0 - /opt/homebrew/bin/node
    npm: 10.9.0 - /opt/homebrew/bin/npm
    pnpm: 9.15.3 - ~/Library/pnpm/pnpm
    bun: 1.1.34 - /opt/homebrew/bin/bun
    Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 132.0.6834.160
    Edge: 132.0.2957.127
    Safari: 17.4
  npmPackages:
    wxt: ^0.19.26 => 0.19.26
Used Package Manager

pnpm

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached Archive.zip and the options page that calls browser.i18n.getMessage, then inspect public/_locales/{en,zh_TW}/messages.json and the generated .output/chrome-mv3 extension. Reproduce the Safari conversion and build steps; done means the Safari options page renders “Options” instead of an empty heading.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.