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
A colon in a parameter value should be passed along with the value after the colon.
i18next.init({lng: "en",resources: {en: {translation: {key: "Before {{date, customdate(format: EEEE d MMMM yyyy HH:mm; otherParam: 0)}}",}}}});i18next.services.formatter.add("customdate",(value,lng,options)=>{return`customized date in format ${options.format} (and other param ${options.otherParam})`;});constnow=newDate();document.getElementById("app").innerHTML=i18next.t("key",{date: now});// Before customized date in format EEEE d MMMM yyyy HH:mm (and other param 0)
Your Environment
runtime version: node v14.16.0
i18next version: 21.6.4
os: Linux
The text was updated successfully, but these errors were encountered:
eric-boot
changed the title
Passed format parameter value is truncated in options argument passed to custom formatter
Passed format parameter value is truncated in options argument of custom formatter
Jan 4, 2022
If you like this module don鈥檛 forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.
馃悰 Bug Report
When using a custom formatter, any passed parameter value with a colon in it is not fully passed to the formatter, but truncated at the colon.
To Reproduce
See codesandbox.
Expected behavior
A colon in a parameter value should be passed along with the value after the colon.
Your Environment
The text was updated successfully, but these errors were encountered: