Skip to content

Commit

Permalink
Merge pull request #177 from aturret/Feature-Simplified-Chinese-trans…
Browse files Browse the repository at this point in the history
…lation

Feature: simplified chinese translation
  • Loading branch information
untra authored Jun 8, 2023
2 parents 9b65257 + be59c13 commit 0b34dac
Show file tree
Hide file tree
Showing 228 changed files with 6,004 additions and 185 deletions.
5 changes: 4 additions & 1 deletion site/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ hello:
nl: Hallo!
he: "שלום!"
ko: 안녕하세요!
zh-CN: 你好!

plugins: [jekyll-polyglot, jekyll-paginate]
# Permalinks
Expand All @@ -45,6 +46,7 @@ exclude: ['LICENSE.md', 'README.md', 'publi.sh', 'Gemfile.lock', 'Gemfile']
title: Polyglot
tagline: 'Straightforward I18n for Jekyll Blogs'
description:
zh-CN: 一款为 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 提供 i18n 多语言功能的插件,方便快捷,适用于各类大小博客。<a href="https://github.com/untra" target="_blank">@untra</a> 出品。
ko: <a href="https://github.com/untra" target="_blank">@untra</a>가 만든, 크고 작은 블로그 모두가 빠르고 직관적인 다국어 지원을 가능케 하는 i18n 지원 <a href="http://jekyllrb.com" target="_blank">Jekyll</a> 플러그인.
he: תוסף תמיכה ב-i18n עבור <a href="http://jekyllrb.com" target="_blank">Jekyll</a> שהופך את התמיכה מרובת שפות למהירה ואינטואיטיבית, עבור בלוגים גדולים וקטנים. תוצרת <a href="https://github.com/untra" target="_blank">@untra</a>.
nl: Een plug-in voor internationlisering van <a href="http://jekyllrb.com" target="_blank">Jekyll</a> die meertalige ondersteuning snel en intuïtief maakt, voor blogs groot en klein. Gemaakt door <a href="https://github.com/untra" target="_blank">@untra</a>.
Expand All @@ -66,6 +68,7 @@ github:
repo: https://github.com/untra/polyglot

#Polyglot
languages: ["en", "es", "de", "fr", "ru", "nl", "he", "ko"]
languages: ["en", "es", "de", "fr", "ru", "nl", "he", "ko", "zh-CN"]
default_lang: "en"
exclude_from_localization: ["javascript", "images", "css", "public"]
parallel_localization: false
5 changes: 5 additions & 0 deletions site/_data/zh-CN/sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1: "你好,欢迎来到示例页面"
2: "请您欣赏本页"
3: "本页面由 _data 目录下的一个 .yml 文件生成"
4: "HTML 标签<i>依然保留</i>"
5: '而链接则会被<a href="/">相对化</a>'
13 changes: 13 additions & 0 deletions site/_posts/zh-CN/2012-02-06-whats-jekyll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: post
title: Jekyll 是什么?
lang: zh-CN
---

[Jekyll](http://jekyllrb.com) 是一款静态网站生成器,同时还是一款开源工具,可用于创建适用于各种形式及尺寸的简单却强大的网站。根据[Jekyll 的官方项目说明](https://github.com/mojombo/jekyll/blob/master/README.markdown):

> Jekyll 是一个简单、具备博客功能的静态网站生成器。Jekyll 接收你的内容,渲染 Markdown 和 Liquid 模板,生成一个完整的静态网站,可以通过Apache、Nginx 或其他 Web 服务器进行提供服务。Jekyll 同时还是 GitHub Pages 背后所采用的引擎,你可以使用它来从你的 GitHub 代码仓库直接托管网站。
它是一款非常有用的工具,我们非常推荐您使用 Hyde 主题部署 Jekyll。

若想了解更多,请[查看项目的 GitHub 页面](https://github.com/mojombo/jekyll)
38 changes: 38 additions & 0 deletions site/_posts/zh-CN/2013-12-28-introducing-hyde.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: post
title: Hyde 介绍
lang: zh-CN
---

Hyde 是一款大胆的双栏 [Jekyll](http://jekyllrb.com) 主题。其采用了突出的侧边栏和简洁的内容的结合。Hyde 基于 Jekyll 的管家 [Poole](http://getpoole.com) 构建。

### 基于 Poole 构建

Poole 是 Jekyll 的管家,是 [@mdo](https://twitter.com/mdo) 开发的用于提供可靠且高效的 Jekyll 主题开发模板。Poole 以及所有基于它构建的 Jekyll 主题(正如本网站正在使用的 Hyde)均包含如下内容:

* 完整的 Jekyll 安装所需内容(版式、配置、[404](/404)[RSS feed](/atom.xml)、文章,以及[示例页面](/about))。
* 对手机显示友好的界面和开发。
* 使用 CSS 中的 `rem` 单位轻松可伸缩的文本和组件大小。
* 支持多种多样的 HTML 标签。
* 每篇文章下方有相关文章(Jekyll 实现的基于时间的排序)。
* 语法高亮功能,感谢 Pygments(基于 Python 的代码片段高亮器)

### Hyde 的特性

除了 Poole 已有的特性外,Hyde 的特性还包括:

* 侧边栏支持文本模块和动态生成的导航菜单,包括活动链接的支持。
* Two orientations for content and sidebar, default (left sidebar) and [reverse](https://github.com/poole/lanyon#reverse-layout) (right sidebar), available via `<body>` classes
* 使用 `<body>` 选择[八种可选配色主题](https://github.com/poole/hyde#themes)

[请阅读文档](https://github.com/poole/hyde#readme)了解更多。

### 浏览器支持

Hyde 是一个面向未来的项目。除了最新版本的 Chrome、Safari(移动和桌面版)和 Firefox 之外,它仅与 Internet Explorer 9 及更高版本兼容。

### 下载

Hyde 代码托管在 GitHub 上,供大家开发。请前往 <a href="https://github.com/poole/hyde">GitHub 代码库</a>进行下载、汇报问题,以及特性提交。

谢谢使用!
11 changes: 11 additions & 0 deletions site/_posts/zh-CN/2015-11-14-polyglot-version-1-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: post
title: Polyglot 版本 1.1.0
lang: zh-CN
---

Polyglot 现已全面支持 [Jekyll 3.0](https://jekyllrb.com/news/2015/10/26/jekyll-3-0-released/) 博客![去试试看吧!](https://github.com/untra/polyglot)

{% highlight yaml %}
gem 'jekyll-polyglot', '~> 1.1.0'
{% endhighlight %}
57 changes: 57 additions & 0 deletions site/_posts/zh-CN/2015-9-19-presenting-polyglot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
layout: post
title: Polyglot 简介
lang: zh-CN
---

在经过数月的打磨后,我很骄傲地为大家介绍 **Polyglot**:为那些*需要*为其受众提供多语言内容的网站所打造的,一款 [Jekyll](http://jekyllrb.com) 的 i18n 插件。

### 特性

尽管市面上存在其他的 Jekyll 多语言插件,Polyglot 却也有其独特之处。多语言插件,Polyglot 在包揽了那些通常留给 Jekyll 开发者去做的脏活累活(比如为了保持不同语言网站下站点地图保持一致而去折腾 url 的写法)的同时,还为他们提供了高效且简单的 SEO 与内容聚合工具。

## 创建相对化链接

在过去,一款静态网站/博客的多语言插件必须费心地跟进维护网站上所提供的每种语言的相对链接。开发者很容易犯错,然后外语访客就会一下子掉进还没翻译的内容之中。

Polyglot 自动化地为每种你希望网站所拥有的语言的 url 进行相对化处理。这可以让网站的访客可以在浏览你的网站时一直使用同一种语言的版本。

## 应变支持

当你*没有*为多语言内容提供翻译版本时,Jekyll 依然会为该语言的子站点根据已有的内容进行构建。而在你*提供*了多语言翻译版本的情况下,Jekyll 会根据该内容对该语言的子站点构建对应内容。就是这么简单。

站点地图对所有语言均保持一致,翻译内容与其所处的子站点一一对应。

## 富文本翻译

一般来讲,富文本内容的多语言翻译很难实现。对一个 Jekyll 网站来说,多语言的短字符串或者某些语言的特定用语很难在显示上保持一致。

*但现在却简单如斯*:只需在你的 `config.yml` 文件中,按照如下方式存储字符串:
{% highlight yaml %}
hello:
en: Hello!
es: ¡hola!
fr: Bonjour!
de: Guten Tag!
{% endhighlight %}
按照如下方式使用 Liquid 模板内容:
{% highlight html %}
{% raw %}
{{ site.hello[site.active_lang]}}
{% endraw %}
{% endhighlight %}
会生成如下内容:
<p class="message">
{{ site.hello[site.active_lang]}}
</p>

## 快速,异步,零成本构建

Polyglot 会和构建你的默认语言站点一样构建你的多语言站点。Polyglot 会以最小的成本在各自独立的进程下*同时*构建你的网站的每种语言的子站点。这意味着,你的网站的构建时间不会因为支持语言的数量而增加。

### 下载

Polyglot 支持 gem 版本,也可以当作 Jekyll 插件使用。可以使用如下代码安装:
{% highlight bash %}
gem install 'jekyll-polyglot'
{% endhighlight %}
46 changes: 46 additions & 0 deletions site/_posts/zh-CN/2016-12-16-Polyglot-1.2.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
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` 的默认值。
37 changes: 37 additions & 0 deletions site/_posts/zh-CN/2016-4-20-Polyglot-1.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: post
title: Polyglot 1.2.0
lang: zh-CN
---

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

{% highlight yaml %}
gem install jekyll-polyglot
{% endhighlight %}

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

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

## {% raw %} {% I18n_Headers %} {% endraw %}

请把这些标签和[你的网站的 url](https://github.com/untra/polyglot/blob/site/_includes/head.html#L6) 一同放入你的 `includes` 文件夹下的 `head.html` 文件中,以此获得最大化的多语言站点 SEO 。其效果与如下 Liquid 代码等同:

{% highlight html %}{% raw %}
<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 %}
{% endraw %}
{% endhighlight %}

同样是要放在你的网页 header 中,但是 Polyglot 的方案更加快捷清晰!若需更多详情,请参照 [SEO 页面](/seo)
32 changes: 32 additions & 0 deletions site/_posts/zh-CN/2017-7-23-Polyglot-1.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
layout: post
title: Polyglot 1.3.0
lang: zh-CN
---

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

{% highlight yaml %}
gem install jekyll-polyglot
{% endhighlight %}

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

* [vlsi](https://github.com/vlsi)
* [pserwylo](https://github.com/pserwylo)

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

现在,在你的 `site.data` 目录下的特定语言内容将会递归地被合并在一起。也就是说,`active_lang` 的内容会优先于 `default_lang` 的内容呈现,也就是优先于非特定语言的内容。([#59](https://github.com/untra/polyglot/pull/59)

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

如果没有在 `languages` 中定义 `default_lang`,本功能会确保没有指定语言的文件(也就是被排除在本地化之外的文件)仍然会被写入站点根目录。([#65](https://github.com/untra/polyglot/pull/65)

### `i18n_headers` 性能提升以及修复

现在,文档处理速度更快了。此外,修复了 `site.url` 被定义时的 `i18n_headers` 处理。([#67](https://github.com/untra/polyglot/pull/67)

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

这将允许 `active_lang` 使用自定义的键,使 Polyglot 可以和其他的插件与主题更好地配合使用。([#68](https://github.com/untra/polyglot/pull/68)
23 changes: 23 additions & 0 deletions site/_posts/zh-CN/2020-04-29-polyglot-1.3.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: post
title: Polyglot 1.3.2
lang: zh-CN
---

Polyglot [1.3.2 版本](https://rubygems.org/gems/jekyll-polyglot/versions/1.3.1) 现已推出!去试试吧!

{% highlight yaml %}
gem install jekyll-polyglot
{% endhighlight %}

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

* [eighthave](https://github.com/eighthave)

### `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](https://po4a.org/).

### 相对和绝对 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.
15 changes: 15 additions & 0 deletions site/_posts/zh-CN/2020-07-19-polyglot-1.3.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: post
title: Polyglot 1.3.3
lang: zh-CN
---

Polyglot [1.3.3 版本](https://rubygems.org/gems/jekyll-polyglot/versions/1.3.3)推出!该版本修复了一个在[全新构建](https://github.com/untra/polyglot/issues/89) 包含 Polyglot 的项目的情况下,运行 `jekyll serve --incremental` 命令时发生的小问题。

{% highlight yaml %}
gem install jekyll-polyglot
{% endhighlight %}

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

* [alexanderadam](https://github.com/alexanderadam)
37 changes: 37 additions & 0 deletions site/_posts/zh-CN/2021-02-07-polyglot-1.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
layout: post
title: Polyglot 1.4.0
lang: zh-CN
---

Polyglot [1.4.0 版本](https://rubygems.org/gems/jekyll-polyglot/versions/1.4.0)现已推出!

{% highlight yaml %}
gem install jekyll-polyglot
{% endhighlight %}

## `href` 属性的静态去相对化

本版本新增了一个 Liquid 块标签 `{% raw %} {% static_href %}href="..."{% endstatic_href %} {% endraw %}`。该块标签可用于创建不受 Polyglot 相对化影响的锚点标签中的href属性。

Jekyll-Polyglot 在相对化处理上有些生硬,所以如果你想要制作一些明确的静态 URL 内容(比如[制作一个语言切换器](https://github.com/untra/polyglot/blob/master/site/_includes/sidebar.html#L40-L42))该 Liquid 标签可以帮助你构建那些不会被扭曲的 `href="..."` 标签。

## 独占式网站语言生成

Polyglot 1.4.0 添加了对 `lang-exclusive: [ ]` 头文件字段的支持。如果对文档添加该头文件字段,将会限制 Jekyll 仅对指明的语言的子站点生成该文档。

{% highlight yaml %}
---
lang-exclusive: ['{{ site.active_lang }}']
---
{% endhighlight %}

这是一种控制哪些语言可以查看该文档的方法,即使该文档在默认语言站点中可能没有相对应的版本。

## 重命名部分 Liquid 标签

`{% raw %} {% static_href %} {% endraw %}` 标签现在也可以使用 `{% raw %} {% Static_Href %} {% endraw %}` 。现存的 `{% raw %} {% I18n_Headers %} {% endraw %}` 标签也可以用 `{% raw %} {% i18n_headers %} {% endraw %}` 来使用。

## 想要看到你的语言吗?

我在募集愿意为 [Jekyll-Polyglot 主页](https://polyglot.untra.io/) 提供属于您的母语版本的志愿者!如果您觉得本软件对您有用,且希望本官方站点以您的语言呈现,请在 [GitHub issues](https://github.com/untra/polyglot/issues)上联系我。
19 changes: 19 additions & 0 deletions site/_posts/zh-CN/2021-04-18-polyglot-1.4.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: post
title: Polyglot 1.4.1
lang: zh-CN
---

Polyglot [1.4.1 版本](https://rubygems.org/gems/jekyll-polyglot/versions/1.4.1)的额外补丁版本已推出!

## 对 i18n_headers 的小修复

Cleanup 时所需的应变功能导致需要进行一些小修复和测试。

## 向我们讲俄语朋友们说声 Привет

网站现已添加俄语支持!

## 想要看到你的语言的特性吗?

我在募集志愿者,为你的语言提供 [Jekyll-Polyglot 项目网站主页](https://polyglot.untra.io/)的多语言支持!如果你觉得这款软件十分有用,且希望以你的语言呈现,请在 [github issues](https://github.com/untra/polyglot/issues) 页面联系我。
Loading

0 comments on commit 0b34dac

Please sign in to comment.