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
I have an SSR application where I create a new i18n instance for each request. The locale is loaded and activated properly before rendering components. However, when I use the plural macro, I receive the following error message:
Lingui: Attempted to call a translation function without setting a locale.
Make sure to call i18n.activate(locale) before using Lingui functions.
This issue may also occur due to a race condition in your initialization logic.
I expect plural to work with my i18n instance from context and compile into something like:
import { i18n } from "@lingui/core";
const message = i18n._({
id: "V/M0Vc",
message: "{count, plural, one {# Book} other {# Books}}",
values: { count },
});
Actual Behavior
It seems like plural is using the global i18n instance instead of the one provided via context. Since the global instance is not activated with the correct locale, this leads to the error.
Would appreciate any guidance on resolving this!
The text was updated successfully, but these errors were encountered:
I have an SSR application where I create a new i18n instance for each request. The locale is loaded and activated properly before rendering components. However, when I use the plural macro, I receive the following error message:
Environment
Code Example
Expected Behavior
I expect plural to work with my i18n instance from context and compile into something like:
Actual Behavior
It seems like plural is using the global i18n instance instead of the one provided via context. Since the global instance is not activated with the correct locale, this leads to the error.
Would appreciate any guidance on resolving this!
The text was updated successfully, but these errors were encountered: