Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egg-i18n 可以支持下 template string 的语法 #58

Closed
atian25 opened this issue Aug 29, 2016 · 6 comments
Closed

egg-i18n 可以支持下 template string 的语法 #58

atian25 opened this issue Aug 29, 2016 · 6 comments

Comments

@atian25
Copy link
Member

atian25 commented Aug 29, 2016

{{ i18nHello ${user.name}, how are you today?}}

@popomore
Copy link
Member

这个好像没啥用,我们都是配置文件。

@atian25
Copy link
Member Author

atian25 commented Aug 29, 2016

支持多一种语法,哈哈

@popomore
Copy link
Member

没想明白改怎么用

@atian25
Copy link
Member Author

atian25 commented Aug 29, 2016

就是在 locals 里面注入个 i18n 这个函数, 然后就可以

{{ i18n`Hello ${user.name}, how are you today?` }}
// vs
{{ __('Hello %s, how are you today?', user.name) }}

@dead-horse
Copy link
Member

这种太慢了,还是不要提供吧,如果要我们来实现的话要 replace

@atian25
Copy link
Member Author

atian25 commented Sep 1, 2016

ok

@atian25 atian25 closed this as completed Sep 1, 2016
elrrrrrrr pushed a commit to elrrrrrrr/egg that referenced this issue Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants