Parser does not parse plural default values when using the Trans component
When generating translation files, the parser does not generate the default English string values for plurals when using the Trans component. The parser does work this way when using t.
To Reproduce
Use a Trans component with a defaultValue_plural passed into tOptions (this example uses JSON v3 plural rules).
When defaultValue_plural is passed into the options of a t call, the parser picks this up and inserts it into the translation JSON at the correct plural key. I would expect the same to happen with the Trans component, but it doesn't seem to. The behavior should be consistent with the Trans component.
In general I'd like to see better support for Trans with default values and plurals, though that may be in the court of the main i18next package. If anyone has any workaround suggestions (besides manually editing the JSON in this case), I'd love to hear it.
Parser does not parse plural default values when using the Trans component
When generating translation files, the parser does not generate the default English string values for plurals when using the
Trans
component. The parser does work this way when usingt
.To Reproduce
Use a
Trans
component with adefaultValue_plural
passed intotOptions
(this example uses JSON v3 plural rules).Expected behavior
With the above example, the following JSON is generated:
I would expect this result:
When
defaultValue_plural
is passed into the options of at
call, the parser picks this up and inserts it into the translation JSON at the correct plural key. I would expect the same to happen with theTrans
component, but it doesn't seem to. The behavior should be consistent with theTrans
component.In general I'd like to see better support for
Trans
with default values and plurals, though that may be in the court of the maini18next
package. If anyone has any workaround suggestions (besides manually editing the JSON in this case), I'd love to hear it.Your Environment