Laczkó Örs
Laczkó Örs

Reputation: 1118

Adding context to translations without using macros in Lingui

How can I turn this translation (that uses macros):

 i18n._(
          msg({
            context: "Validation",
            message: `${fieldLabel} should be before ${maxTime}.`,
          })
 ),

to something like this:

i18n._({
          id: "{fieldLabel} should be before {maxTime}.",
          message: "{fieldLabel} should be before {maxTime}.",
          values: {
            fieldLabel,
            maxTime,
          },
}),

I could find a way to include context without macros. My goals are:

Upvotes: 0

Views: 78

Answers (0)

Related Questions