browser.i18n.getMessage does not work on Safari extension:
Nobody has claimed this yet.
- 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
Steps to reproduce
-
create a wxt-demo
-
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
-
build chrome extension
pnpm i && pnpm build -
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
-
build safari extension with Xcode
-
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
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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