diff --git a/LATEST_CHANGES.md b/LATEST_CHANGES.md index c15d4e7cbd..a952c861c1 100644 --- a/LATEST_CHANGES.md +++ b/LATEST_CHANGES.md @@ -11,6 +11,7 @@ * Add support for downloading page sources with ?raw (@tstein). * Add openssh client to docker images for ssh: repo support. (@jagerkin). * Add support for mathematical typesetting using KaTeX (@dometto). Users can now choose between MathJax and KaTeX with the --math flag. +* Add support for more languages (such as: Chinese). ## Fixes & Improvements diff --git a/lib/gollum.rb b/lib/gollum.rb index 37dc6ceaab..aa2bb60e18 100644 --- a/lib/gollum.rb +++ b/lib/gollum.rb @@ -16,8 +16,9 @@ module Gollum VERSION = '5.3.0' KEYBINDINGS = ['default', 'vim', 'emacs'] - ::I18n.available_locales = [:en] + ::I18n.available_locales = [:en, :cn] ::I18n.load_path = Dir[::File.expand_path("../gollum/locales", __FILE__) + "/*.yml"] + ::I18n.default_locale = :en def self.assets_path ::File.expand_path('gollum/public', ::File.dirname(__FILE__)) diff --git a/lib/gollum/locales/cn.yml b/lib/gollum/locales/cn.yml new file mode 100644 index 0000000000..3d2d3f6a19 --- /dev/null +++ b/lib/gollum/locales/cn.yml @@ -0,0 +1,103 @@ +cn: + create: + title: 创建新的页面 + edit: 编辑 + preview: 预览 + navbar: + home_button: 首页 + overview_button: 总览 + latest_changes_button: 修改记录 + history_button: 历史版本 + upload_button: 上传文件 + rename_button: 重命名 + edit_button: 编辑 + new_button: 新建 + searchbar: + placeholder: 搜索 + aria: + label: 站内搜索 + wiki_content: + last_edit: 显示最后修改信息 + delete_link: + title: 删除页面 + confirm: 确定要删除此页面吗? + editor: + restore_button: + value: 恢复 + prompt: 自动保存可用,单击按钮恢复。 + function_bar: + heading1: + value: 标题1 + title: 一级标题 + heading2: + value: 标题2 + title: 二级标题 + heading3: + value: 标题3 + title: 三级标题 + link: 链接 + image: 图片 + bold: 加粗 + italic: 斜体 + code: 代码块 + unordered_list: 无序列表 + ordered_list: 有序列表 + blockquote: 引用块 + horizontal_rule: 水平标尺 + accept_selected_criticMarkup: 接受选定的标注 + reject_selected_criticMarkup: 拒绝选定的标注 + reverse_text_direction: 反转文本方向 + help: 帮助 + keybinding: 设置按键绑定 + wiki_format: 设置此页面的格式 + rendering_unavailable_for: 渲染不可用 + save_button: + value: 保存 + title: 保存当前更改 + cancel_button: + value: 取消 + title: 取消编辑 + confirm: 取消编辑可能会导致当前已编辑内容丢失。您确定要继续吗? + note: + title: "提示:" + content: "此页面将创建在 %{path} 目录中。" + pagination: + aria: + label: 页码 + next_page: 下一页 + previous_page: 上一页 + next: 前进 + previous: 后退 + precious/views/compare: + back_to_page_history: 返回历史 + back_to_top: 回到顶部 + comparison_of: 比较 + comparing_versions_of: "%{name} 的版本差异" + comparing_from: "%{before} 和 %{after}" + revert: 撤销更改 + precious/views/edit: + edit: 编辑 + preview: 预览 + title: "编辑 %{title}" + precious/views/error: + error: 错误 + precious/views/history: + browse_in_history_description: 查看此版本 + compare_revisions: 比较差异 + history_for: "%{name} 的历史版本" + precious/views/latest_changes: + title: 修改记录 (所有页面) + precious/views/layout: + title: 主页 + precious/views/overview: + back_to_top: 回到顶部 + delete_confirmation: "确定要删除 %{name} 吗?" + no_pages_in: "%{ref} 中没有页面。" + title: "%{ref} 总览" + precious/views/search: + aria: + show_all: Show all hits on this page + back_to_top: 回到顶部 + no_results: 找不到任何您要搜索的内容。 + search_results_for: "%{query} 的搜索结果" + title: "%{query} 的搜索结果" diff --git a/lib/gollum/locales/en.yml b/lib/gollum/locales/en.yml index bfff941355..43ea661368 100644 --- a/lib/gollum/locales/en.yml +++ b/lib/gollum/locales/en.yml @@ -1,7 +1,66 @@ en: + create: + title: Create New Page + edit: Edit + preview: Preview + navbar: + home_button: Home + overview_button: Overview + latest_changes_button: Latest Changes + history_button: History + upload_button: Upload + rename_button: Rename + edit_button: Edit + new_button: New + searchbar: + placeholder: Search + aria: + label: Search site + wiki_content: + last_edit: When was this page last modified? + delete_link: + title: Delete this Page + confirm: Are you sure you want to delete this page? editor: + restore_button: + value: Restore Text + prompt: Autosaved text is available. Click the button to restore it. function_bar: + heading1: + value: H1 + title: Heading 1 + heading2: + value: H2 + title: Heading 2 + heading3: + value: H3 + title: Heading 3 + link: Link + image: Image + bold: Bold + italic: Italic + code: Code + unordered_list: Unordered list + ordered_list: Ordered list + blockquote: Blockquote + horizontal_rule: Horizontal rule + accept_selected_criticMarkup: Accept Selected CriticMarkup + reject_selected_criticMarkup: Reject Selected CriticMarkup + reverse_text_direction: Reverse Text Direction help: Help + keybinding: Set your preferred keybinding + wiki_format: Set this page's format to + rendering_unavailable_for: Rendering unavailable for + save_button: + value: Save + title: Save current changes + cancel_button: + value: Cancel + title: Cancel editing + confirm: Cancelling may result in data loss. Are you sure you wish to proceed? + note: + title: "NOTE:" + content: "This page will be created within the %{path} directory." pagination: aria: label: Pagination @@ -13,7 +72,7 @@ en: back_to_page_history: Back to Page History back_to_top: Back to Top comparison_of: Comparison of - comparing_versions_of: Comparing versions of + comparing_versions_of: "Comparing versions of %{name}" comparing_from: "Comparing %{before} to %{after}" revert: Revert Changes precious/views/edit: @@ -25,7 +84,7 @@ en: precious/views/history: browse_in_history_description: Browse the page at this point in the history compare_revisions: Compare Revisions - history_for: History for + history_for: "History for %{name}" precious/views/latest_changes: title: Latest Changes (Globally) precious/views/layout: @@ -33,13 +92,12 @@ en: precious/views/overview: back_to_top: Back to Top delete_confirmation: "Are you sure you want to delete %{name}?" - no_pages_in: There are no pages in - on: "on" + no_pages_in: "There are no pages in on %{ref}." title: "Overview of %{ref}" precious/views/search: aria: show_all: Show all hits on this page back_to_top: Back to Top - no_results: There are no results for your search - search_results_for: Search results for + no_results: There are no results for your search. + search_results_for: "Search results for %{query}" title: "Search results for %{query}" diff --git a/lib/gollum/templates/compare.mustache b/lib/gollum/templates/compare.mustache index f3f33aa165..6036c8020f 100644 --- a/lib/gollum/templates/compare.mustache +++ b/lib/gollum/templates/compare.mustache @@ -3,10 +3,7 @@ {{>navbar}}

- - {{t.comparing_versions_of}} - - {{name}} + {{t.comparing_versions_of}}

diff --git a/lib/gollum/templates/create.mustache b/lib/gollum/templates/create.mustache index ff2bcc0709..9f89d7145c 100644 --- a/lib/gollum/templates/create.mustache +++ b/lib/gollum/templates/create.mustache @@ -3,16 +3,16 @@ {{>navbar}}

- Create New Page + {{tt.create.title}}

diff --git a/lib/gollum/templates/editor.mustache b/lib/gollum/templates/editor.mustache index e80a8670c7..dab067fbef 100644 --- a/lib/gollum/templates/editor.mustache +++ b/lib/gollum/templates/editor.mustache @@ -11,7 +11,7 @@ {{#has_path}} -

NOTE: This page will be created within the "{{path}}" directory

+

{{tt.editor.note.title}} {{tt.editor.note.content}}

{{/has_path}}
{{/is_create_page}} @@ -24,37 +24,37 @@
- - - + + +
- - + +
- - - + + +
- - - - + + + +
{{#critic_markup}}
- - + +
{{/critic_markup}} - + {{/enabled}} {{/formats}} -
Rendering unavailable for
+
{{tt.editor.function_bar.rendering_unavailable_for}}
{{#formats}} {{^enabled}}
@@ -206,8 +206,8 @@
- - Cancel + + {{tt.editor.cancel_button.value}}
diff --git a/lib/gollum/templates/history.mustache b/lib/gollum/templates/history.mustache index 7a3deda30f..be9872ec8d 100644 --- a/lib/gollum/templates/history.mustache +++ b/lib/gollum/templates/history.mustache @@ -3,10 +3,7 @@ {{>navbar}}

- - {{t.history_for}} - - {{name}} + {{t.history_for}}

diff --git a/lib/gollum/templates/navbar.mustache b/lib/gollum/templates/navbar.mustache index 66ab71b837..3b7fb9bdc3 100644 --- a/lib/gollum/templates/navbar.mustache +++ b/lib/gollum/templates/navbar.mustache @@ -14,7 +14,7 @@ @@ -33,7 +33,7 @@ onclick="window.location.href='{{overview_path}}';" id="minibutton-overview" > - Overview + {{tt.navbar.overview_button}} {{/overview}} @@ -43,7 +43,7 @@ onclick="window.location.href='{{latest_changes_path}}';" id="minibutton-latest-changes" > - Latest Changes + {{tt.navbar.latest_changes_button}} {{/latest_changes}} @@ -57,7 +57,7 @@ onclick="window.location.href='{{history_path}}/{{escaped_url_path}}/{{version}}';" id="minibutton-history" > - History + {{tt.navbar.history_button}} {{/history}} @@ -66,7 +66,7 @@ {{/allow_uploads}} @@ -74,14 +74,14 @@ {{/editable}} {{/allow_editing}} @@ -92,7 +92,7 @@ {{#editable}}
{{/editable}} @@ -101,7 +101,7 @@ {{#newable}}
{{/newable}} diff --git a/lib/gollum/templates/overview.mustache b/lib/gollum/templates/overview.mustache index d840e0ca96..b21df0fc47 100644 --- a/lib/gollum/templates/overview.mustache +++ b/lib/gollum/templates/overview.mustache @@ -42,9 +42,6 @@ {{#no_results}}

{{t.no_pages_in}} - {{current_path}} - {{t.on}} - {{ref}}.

{{/no_results}} diff --git a/lib/gollum/templates/search.mustache b/lib/gollum/templates/search.mustache index 2c488cacca..1ad35ca2a4 100644 --- a/lib/gollum/templates/search.mustache +++ b/lib/gollum/templates/search.mustache @@ -3,10 +3,7 @@ {{>navbar}}

- - {{t.search_results_for}} - - {{name}} + {{t.search_results_for}}

@@ -41,7 +38,7 @@ {{#no_results}}

- {{t.no_results}} {{query}}. + {{t.no_results}}

{{/no_results}} diff --git a/lib/gollum/templates/searchbar.mustache b/lib/gollum/templates/searchbar.mustache index a89af6be0d..c9f610b9be 100644 --- a/lib/gollum/templates/searchbar.mustache +++ b/lib/gollum/templates/searchbar.mustache @@ -1,3 +1,3 @@
- +
\ No newline at end of file diff --git a/lib/gollum/templates/wiki_content.mustache b/lib/gollum/templates/wiki_content.mustache index 9a3973c9b9..e87737bafb 100644 --- a/lib/gollum/templates/wiki_content.mustache +++ b/lib/gollum/templates/wiki_content.mustache @@ -47,10 +47,10 @@