javascript - hexo中的 `__()`(双下划线)函数是什么?

标签 javascript jquery css ejs hexo

最近在学习搭建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.

查看更多:https://hexo.io/docs/internationalization.html

关于javascript - hexo中的 `__()`(双下划线)函数是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51340450/

相关文章:

javascript - 如何将连接、组件和功能导出到一处? (只需要建议)

javascript - QML context2d 线宽

javascript - jquery从右到左移动div

javascript - ChartJS 图表不在选项卡内生成

html - bootstrap - 根据屏幕大小应用类

javascript - 如何防止对我用 node.js 编写的 http 服务器的 DOS 攻击?

javascript - jQuery 在表单内的 div 中选择 div

html - Youtube 视频嵌入 - 不显示

css - 使用 css 悬停时的动画蒙版和隐藏圆圈

Javascript 正则表达式允许在金额中使用逗号