Closed akeinhell closed 5 years ago
Is it possible to add your own functions to the templates, for example pluralize.js?
example
const i18n = new telegrafI18n({ context: { functions: { hello: (str) => `great ${str}` } } });
template:
key: hello, ${hello('world')}
will be produce string hello, great world
hello, great world
@akeinhell from version 6.6.0 you can define custom functions for template engine. See example
6.6.0
Is it possible to add your own functions to the templates, for example pluralize.js?
example
template:
will be produce string
hello, great world