--- layout: post title: Polyglot 1.2.4 lang: zh-CN --- Polyglot 的全新版本现已推出。去试试吧! {% highlight yaml %} gem install jekyll-polyglot {% endhighlight %} 本版本由 GitHub 用户 [vlsi](https://github.com/vlsi) 的热心支持提供,他修复了一些 bug,并添加了下列新特性: ### 支持绝对 URL 的多语言翻译版本 Polyglot 现在会翻译你的 `site.url`,因此,绝对 URL 也会得到翻译了。 ### 支持对全部 Jekyll 合集的翻译 [Jekyll 合集](https://jekyllrb.com/docs/collections/)是一项 Jekyll 的全新特性。本次更新也会把所有现有合集都进行翻译,而不只有文章和页面。 ### 当 `site.data[:lang]` 存在时,对 `site.data` 的富文本使用语言特定的 `_data` 内容翻译 根目录下的富文本会在生成时。之前如果想要渲染富文本内容,你需要按照如下方式使用: {% highlight html %} {% raw %} {{ site.data[site.active_lang].richTextString }} {% endraw %} {% endhighlight %} 现在,富文本内容可以直接使用如下标签进行渲染: {% highlight html %} {% raw %} {{ site.data.richTextString }} {% endraw %} {% endhighlight %} ### `I18n_Headers` 在留空时使用来自 `site.url` 的默认值 用户现在可以在不指定特定 url 的情况下使用下列标签: {% highlight html %} {% raw %} {% I18n_Headers %} {% endraw %} {% endhighlight %} 这些标签将会使用你的 `site.url` 的默认值。