TranslateParser API
The TranslateParser
is responsible for formatting the translated messages
and using parameters that are passed in.
Usually, you would not use the TranslateParser
directly. It’s called in the
background when a translation string is requested in your app.
It’s also most likely that you don’t have to create your own parser at all.
The default parser
interpolate
Interpolates a string to replace parameters or calls the interpolation function with the parameters.
Example:
Returns This is a banana!
Example:
Returns This is a banana!
Custom parser
A TranslateParser
implements this interface - you can create your
own parser and plug in into the TranslateModule
using
the config.