Introduction
INFO
You don't have to use wxt
to use this package - it will work in any bundler setup. See Installation without WXT for more details.
@wxt-dev/i18n
is a simple, type-safe wrapper around the browser.i18n
APIs. It provides several benefits over the standard API:
- Simple messages file format
- Plural form support
- Integrates with the I18n Ally VS Code extension
It also provides several benefits over other non-web extension specific i18n packages:
- Does not bundle localization files into every entrypoint
- Don't need to fetch the localization files asynchronously
- Can localize extension name in manifest
- Can access localized strings inside CSS files
However, it does have one major downside:
- Like the
browser.i18n
API, to change the language, users must change the browser's language