You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Given I'm using webpack in production mode and "fallbackLocale": "en" is set in .linguirc
Given a trans component with some variable:
<Trans> Hello {name}</Trans>
When using i18nProvider and setupI18n
constcatalogs={en: enCatalog};exportconsti18n=setupI18n({ catalogs,language: DEFAULT_LOCALE});// ===// Please note language is dynamic here, as it's taken from session config<I18nProvideri18n={i18n}language={sessionConfig.locale||DEFAULT_LOCALE}catalogs={catalogs}>
When language is set to existing catalog (en), everything works fine.
But when language is set to non existing catalog (let's say es), then interpolation won't work and "Hello {name}" will be rendered.
Expected behavior
It should interpolate strings, even if given catalog doesn't exists (given that fallbackLocale is set)
Additional context
Add any other context about the problem here.
jsLingui version 2.7.4
Babel version babel-core@7.0.0-bridge.0 + "@babel/core": "7.3.4",
Hi @ppozniak,
unfortunatelly this is "expected". Since the messages are compiled at build time, there's no runtime parser and you can't format messages (e.g. default ones) at runtime.
Next version will probably support optional runtime parsing.
Connected to:
#385
Describe the bug
Given I'm using webpack in production mode and "fallbackLocale": "en" is set in .linguirc
Given a trans component with some variable:
When using i18nProvider and
setupI18n
When language is set to existing catalog (en), everything works fine.
But when language is set to non existing catalog (let's say es), then interpolation won't work and "Hello {name}" will be rendered.
Expected behavior
It should interpolate strings, even if given catalog doesn't exists (given that fallbackLocale is set)
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: