Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call IntlMessageFormat in transChoice method #341

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cbwar
Copy link

@cbwar cbwar commented Dec 27, 2022

IntlMessageFormat is not called in transChoice method

symfony xliff file

<trans-unit id="trans.test1">
    <source>trans.test1</source>
    <target>né(e) le {date}</target>
</trans-unit>
<trans-unit id="trans.test2">
    <source>trans.test2</source>
    <target>[0,18[ né(e) le {date} (moins de 18 ans) | ]1,+Inf] né(e) le {date} ({age} ans)</target>
</trans-unit>

js code

Translator.trans('trans.test1', {'date': moment().format("DD/MM/YYYY")});
Translator.transChoice('trans.test2', 21, {'date': moment().format("DD/MM/YYYY"), 'age': 21});
Translator.transChoice('trans.test2', 5, {'date': moment().format("DD/MM/YYYY"), 'age': 5});

browser console output

2022-12-27 12_23_42-Window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant