I have this phrase :
{{ __("counter.description:This promotion is limited to X participants") }}
I want to change the X by a variable
My key is counter.description
And I tried to do this in my singular value : This promotion is limited to {{totalParticipation}} participants
But it's not working.
Di you have any idea on how to do this ?
This is the right way to get the result you are looking for:
i18n/en.jsonfile inside any module of your Apostrophe project. Important: this must be in a subdirectory calledi18ninside your module. Otherwise it will not be found and loaded for you.When you're ready to actually translate, copy
en.jsontofr.json,es.json, etc. (or whatever your configured locales are) in the same directory and translate the contents, keeping the key names and interpolated variable names the same, just translate the text.Don't forget to actually configure those same locales in the
@apostrophecms/i18nmodule, otherwise they won't be picked up.See documentation links below:
https://docs.apostrophecms.org/guide/localization/static.html https://docs.apostrophecms.org/guide/localization/overview.html#configuring-locales