Polyglot 1.3.3

Polyglot 1.3.3 版本推出!该版本修复了一个在全新构建 包含 Polyglot 的项目的情况下,运行 jekyll serve --incremental 命令时发生的小问题。

gem install jekyll-polyglot

本次发布得益于以下GitHub用户的支持!

Polyglot 1.3.2

Polyglot 1.3.2 版本 现已推出!去试试吧!

gem install jekyll-polyglot

本次发布得益于以下 GitHub 用户的支持:

lang_from_path 设置 setting to derive document lang from relative path

This release adds a new boolean configuration setting lang_from_path. When set to true, this option tells polyglot to derive the base language from a matching subpath if the lang frontmatter is not set. This setting works well in conjunction with other translation maintenance tools such as po4a.

相对和绝对 url 的相对化逻辑优化

excluded_from_localization files will have trailing slashes added to their paths if they are directories. In addition, these files will be matched differently in the relativize and absolute url regex matchers. This will improve the accuracy of url relativization based on user feedback.

Polyglot 1.3.0

Polyglot 的全新版本现已推出。去试试吧!

gem install jekyll-polyglot

本次发布得益于以下 GitHub 用户的支持:

递归式合并不同语言特定的 site.data

现在,在你的 site.data 目录下的特定语言内容将会递归地被合并在一起。也就是说,active_lang 的内容会优先于 default_lang 的内容呈现,也就是优先于非特定语言的内容。(#59

未指定语言的文件仍然会被写入 default_lang 的站点根目录

如果没有在 languages 中定义 default_lang,本功能会确保没有指定语言的文件(也就是被排除在本地化之外的文件)仍然会被写入站点根目录。(#65

i18n_headers 性能提升以及修复

现在,文档处理速度更快了。此外,修复了 site.url 被定义时的 i18n_headers 处理。(#67

自定义站点配置文件中的 active_lang

这将允许 active_lang 使用自定义的键,使 Polyglot 可以和其他的插件与主题更好地配合使用。(#68

Polyglot 1.2.4

Polyglot 的全新版本现已推出。去试试吧!

gem install jekyll-polyglot

本版本由 GitHub 用户 vlsi 的热心支持提供,他修复了一些 bug,并添加了下列新特性:

支持绝对 URL 的多语言翻译版本

Polyglot 现在会翻译你的 site.url,因此,绝对 URL 也会得到翻译了。

支持对全部 Jekyll 合集的翻译

Jekyll 合集是一项 Jekyll 的全新特性。本次更新也会把所有现有合集都进行翻译,而不只有文章和页面。

site.data[:lang] 存在时,对 site.data 的富文本使用语言特定的 _data 内容翻译

根目录下的富文本会在生成时。之前如果想要渲染富文本内容,你需要按照如下方式使用:

{{ site.data[site.active_lang].richTextString }}

现在,富文本内容可以直接使用如下标签进行渲染:

{{ site.data.richTextString }}

I18n_Headers 在留空时使用来自 site.url 的默认值

用户现在可以在不指定特定 url 的情况下使用下列标签:

{% I18n_Headers %}

这些标签将会使用你的 site.url 的默认值。

Polyglot 1.2.0

Polyglot 的全新版本现已推出。去试试吧!

gem install jekyll-polyglot

此外,还请把 jekyll-polyglot 添加到你的网站的 _config.yml 的 gem 列表中。

本版本主要是为接下来的新特性以及更好的多语言内容管理提供基础准备。此外,本版本还包括了一些新特性:

{% I18n_Headers %}

请把这些标签和你的网站的 url 一同放入你的 includes 文件夹下的 head.html 文件中,以此获得最大化的多语言站点 SEO 。其效果与如下 Liquid 代码等同:

<meta http-equiv="Content-Language" content="{{site.active_lang}}">
<link rel="alternate"
      hreflang="{{site.default_lang}}"
      href="http://yoursite.com{{page.permalink}}" />
{% for lang in site.languages %}
{% if lang == site.default_lang %}
  {% continue %}
{% endif %}
<link rel="alternate"
    hreflang="{{lang}}"
    href="http://yoursite.com/{{lang}}{{page.permalink}}" />
{% endfor %}

同样是要放在你的网页 header 中,但是 Polyglot 的方案更加快捷清晰!若需更多详情,请参照 SEO 页面