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
Use-Case:
We have a 'Person' model with a name, a lastLogin timestamp, and a favorite dateFormat for the person. The Translation team would like to display a translated welcome message for the Person. person = { name: 'John', lastLogin: '2025-02-14T20:14:14', preferredDateFormat: 'dd.MM.yyyy HH:mm' } {{ 'personSummary' | transloco: person }}
given a provided FunctionalTranspiler function 'formatDate,' and the following translation (english). personSummary: 'Welcome {{name}}, your last login [[formatDate({{lastLogin}},{{preferredDateFormat}})].'
it should display "Welcome John, your last login 14.02.2025 20:14."
Note: it should not be a breaking change since transpiling something without curly braces or square brackets gives the same back (no-op), and when providing arguments to FunctionalTranspiler functions in your example in the docs they are plain strings (e.g. [[ hasFeatureFlag(newDashboards, has flag, missing flag) ]]). Furthermore it does not need fixing any existing tests.
I'd gladly elaborate more if you want to discuss it through, but I tried to keep my use case short. ;) Thks @shaharkazaz .
Is there an existing issue for this?
Which Transloco package(s) will this feature affect?
Transloco
Is your feature request related to a problem? Please describe
No response
Describe the solution you'd like
Each argument of a function should be transpilled, which would allow to define more flexible/generic functions
Describe alternatives you've considered
Additional context
No response
I would like to make a pull request for this feature
Yes 🚀
The text was updated successfully, but these errors were encountered: