最近在学习搭建hexo主题,但是对__()
函数有点迷茫。我没有在 hexo doc 中找到答案。我不知道这是内置的还是什么?
这段代码来自 theme-minos:
<span class="column is-narrow">
<% let words = word_count(post._content); %>
<% let time = duration((words / 150.0) * 60, 'seconds') %>
<%= `${ time.humanize() } ${ __('article.read')} (${ __('article.about') } ${ words } ${ __('article.words') })` %>
</span>
谁能帮帮我?
最佳答案
终于在hexo文档中找到了答案。
Use
__
or_p
helpers in templates to get the translated strings. The former is for normal usage and the latter is for plural strings.
关于javascript - hexo中的 `__()`(双下划线)函数是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51340450/