npm install catberry-l10n-dust-helper --save
You can use dustjs helper that puts localized value wherever you want:
{@l10n key="SOME_LOCALIZATION_KEY" locale="en-us" count=5 /}
key
- localization keylocale
- current user localization (optional)count
- pluralization count (optional)
Let's say we have such localization dictionary:
{
"COMMENT": ["comment", "comments"]
}
And we use such helper parameters:
{@l10n key="COMMENT" locale="en-us" count=1 /}
It outputs comment
word.
{@l10n key="COMMENT" locale="en-us" count=5 /}
It outputs comments
word.
Also, if you have locale
value in template data context it is not needed to
specify parameter locale
in helper because it will be automatically used from
template data context.
There are a lot of ways to contribute:
- Give it a star
- Join the Gitter room and leave a feedback or help with answering users' questions
- Submit a bug or a feature request
- Submit a PR
Denis Rechkunov [email protected]