-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interpolation doesn't work with invalid initialLocale #209
Comments
By bisecting this repo, I have verified that the issue was introduced in d1d0306 - this is quite strange... |
Ok, turns out that in the process of switching to pnpm, |
For me it did not work on the server even when setting the E.g. format('key', { values: { ... }, locale: 'en' }) Message was resolved, but values were not replaced, with a console error being logged:
Downgraded the package for now... |
Hi, |
Released 3.7.3 which should help with both issues: #229 |
Thanks for the fix and sorry for the trouble! |
What I observed appears to have a different source. Somehow the modules are resolved the wrong way. My application's import resolves to var IntlMessageFormat = require('intl-messageformat');
....
IntlMessageFormat.resolveLocale
...
new IntlMessageFormat(message, ...) But the Unfortunately, I have not been able to create a minimal reproduction so far. The logged errors could maybe be more generic, as these are lies:
|
Describe the bug
Hi,
I have an app that gets its initial locale populated (via string replacement) by the server at runtime (weird, I know...) and a fallback locale set manually to "en". I noticed after an update that when the
intialLocale
doesn't get populated (e.g. in tests) and is therefore invalid, formatting still works (using the fallback locale), but interpolation stops working, showing property names (i.e.{myValue}
) instead of the actual values.To Reproduce
TBD...
To help us help you, if you've found a bug please consider the following:
Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that
svelte-preprocess
is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.Expected behavior
Interpolation works and the fallback locale is used
Information about your project:
Your browser and the version: Electron 106
Your operating system: Debian testing
svelte-i18n
version: Works in 3.2.0, broken in 3.4.0Whether your project uses Webpack or Rollup: Webpack
The text was updated successfully, but these errors were encountered: