Feature request: Add support for manually setting or overriding the locale in @wxt-dev/i18n
### Feature Request
Add support for manually setting or overriding the current locale in `@wxt-dev/i18n`.
Currently, `@wxt-dev/i18n` follows the browser language, which is consistent with the `browser.i18n` API. However, some extensions need to provide an in-app language setting so users can choose the UI language independently from their browser language.
For example, some Japanese users may prefer to display the extension UI in English instead of Japanese, even though their browser language is Japanese.
A possible API could be:
```ts
i18n.setLocale('en')
```
This would make it possible for developers to let users select their preferred language inside the extension.
#### Is your feature request related to a bug?
N/A
### What are the alternatives?
The current alternative is to ask users to change their browser language, but this is not ideal because it affects the entire browser instead of only the extension.
Another possible workaround is to build a custom i18n system outside of `@wxt-dev/i18n`, but that would duplicate functionality already provided by WXT and make the extension more complex to maintain.
### Additional context
`@wxt-dev/i18n` currently follows the browser language automatically. This works well for most cases, but it does not support user-selectable language preferences inside an extension.
In my case, some Japanese users prefer to use the extension UI in English instead of Japanese. It would be helpful if the extension could store the user’s preferred language and apply it only to the extension UI without requiring changes to the browser’s language settings.
0 条评论