Localization
Translations
Symfony translations are made available through BazingaJsTranslationBundle.
The library will transform the JSON translations defined in MY_PLUGIN/Resources/translations
when you run
the command :
1
$ php bin/console bazing:js-translation:dump public/js --format=js --merge-domains
You may need to empty the symfony cache and your browser cache to see the changes.
You can now access the translations with the following code in JS :
1
2
3
4
import {trans, transChoice} from '#/main/app/intl/translation'
trans(translationKey, placeholders = {}, domain = 'platform')
transChoice(translationKey, count, placeholders = {}, domain = 'platform')
Dates
Dates are managed by MomentJS.