Format strings
Issue #1
resolved
How could I use sprintf-js to format strings that should be translated? Can you help me?
Comments (5)
-
repo owner -
reporter An error occoured =(
sprintf is not a function
-
repo owner Because
require('sprintf-js')
is an object and hassprintf()
function inside.data: { sprintf: require('sprintf-js').sprintf }
You should know what module contains, not me :)
-
repo owner - changed status to resolved
-
reporter Hey @dogancelik, how to use json data with pug-i18n? Something like https://tusharghate.com/rendering-pug-templates-with-multiple-data-files
- Log in to comment
First you need to pass
sprintf-js
to the plugin function like so:Then you can use
sprintf
function inside Pug: