eggjs / eggjs/egg

Adding new function to Nunjucks

Open
#4,807 7 comments 0 reactions 0 assignees View on GitHub
Inactive plugin: egg-i18n plugin: egg-view-nunjucks Question
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

In [documentation ](https://eggjs.org/en/core/i18n.html#use-in-view) we have

```html

  • {{ __('Email') }}: {{ user.email }}


  • {{ __('Welcome back, %s!', user.name) }}


  • {{ __('Hello {0}! My name is {1}.', ['foo', 'bar']) }}

  • ```

    I want to know how you add `__` to the Nunjucks, I need to add a `t` function for my localizations
    Can you please show me the source code?

    Contributor guide

    Open the contributing guide

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.