Open sm2017 opened 2 years ago
@sm2017 hello, you can set a t
alias function to __
like gettext does.
app.context.t = app.context.__;
@fengmk2 I read the source codes, but cannot find where you defined app.context.__
in the Nunjucks, can you please show me the code?
@sm2017
egg will set __
function to ctx.locals then merge all locals on view plugin before pass to nunjucks engine.
@fengmk2 thanks a lot
@sm2017 hello, you can set a
t
alias function to__
like gettext does.app.context.t = app.context.__;
The t
function is the i18next.t
function, So I don't want to override it
Is it safe to use the following code?
ctx.locals.t = t
@fengmk2 @atian25 Can you please reply ? is it safe to override ctx.locals.t = t?
@fengmk2 I need your help!
In documentation we have
I want to know how you add
__
to the Nunjucks, I need to add at
function for my localizations Can you please show me the source code?