js-lingui icon indicating copy to clipboard operation
js-lingui copied to clipboard

i18n._ function removes unrecognized macros

Open nmoinvaz opened this issue 3 years ago • 0 comments

Describe the bug i18n._ removes macros that are unrecognized. This prevents programs that also parse macros in strings from handling them after Lingui loads them.

To Reproduce Using the following code:

i18n._("code {hello}")

The string returned is code .

Expected behavior It should return code {hello} because no values object was passed to i18n._.

Alternatives ideas

  1. Perhaps there is a callback that can be triggered when it encounters a macro it doesn't recognize?
  2. Or an option that can be enabled for this behavior?
  3. Or another function that does not process macros but can get the locale string.

nmoinvaz avatar Aug 18 '22 19:08 nmoinvaz