Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traditional Chinese Translation-templates #1418

Merged
merged 12 commits into from
Nov 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/config/2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"settings": [
{
"is_live": true,
"supported_languages": ["en","es","fr","ja","pt","zh-CN"],
"supported_languages": ["en","es","fr","ja","pt","zh-CN","zh-CHT"],
"ebook_languages": ["en","ja"]
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/config/2020.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"settings": [
{
"is_live": true,
"supported_languages": ["en","es","fr","ja","pt","zh-CN"],
"supported_languages": ["en","es","fr","ja","pt","zh-CN","zh-CHT"],
"ebook_languages": []
}
],
Expand Down
1 change: 1 addition & 0 deletions src/server/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Language(object):
JA = _Language('日本語', 'ja')
PT = _Language('Português', 'pt')
ZH_CN = _Language('简体中文', 'zh-CN')
ZH_CHT = _Language('繁體中文', 'zh-CHT')
AbbyTsai marked this conversation as resolved.
Show resolved Hide resolved


DEFAULT_LANGUAGE = Language.EN
Expand Down
188 changes: 188 additions & 0 deletions src/templates/zh-CHT/2019/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
{% extends "base/2019/base.html" %}

{% block description %}Web Almanac 網路年鑑是網路狀態的年度報告,其集結網路社群的專業知識共同精萃HTTP Archive的數據與趨勢。{% endblock %}

{% block twitter_image_alt %}{{ year }} Web Almanac{% endblock %}

{% block skip_navigation %}離開導覽{% endblock %}

{% block organization %}Web Almanac 精粹自 HTTP Archive{% endblock %}
{% block web_almanac_logo %}
<span class="wa">Web Almanac</span>
<span class="line-group">
<span class="pre">精粹自</span>
<span class="ha">HTTP Archive</span>
</span>
{% endblock %}

{% block mission %}
<p>
我們的任務是結合網路社群的專業知識共同精萃HTTP Archive的原始數據與趨勢。Web Almanac 網路年鑑是網路狀態的綜合報告,其由真實的數據和具信譽的網路專家支持。報告共有20個章節橫跨網頁內容、使用者體驗、網頁發佈、網頁傳遞的各個方面。
</p>
{% endblock %}

{% block read_last_years_almanac %}閱讀 {{ year | int - 1 }} Web Almanac{% endblock %}

{% block http_archive_link %}HTTP Archive 主頁{% endblock %}

{% block page_navigation %}網頁導覽{% endblock %}

{% block help_translate %}幫助翻譯{% endblock %}
{% block translation_not_available %}英文 - 中文不能使用{% endblock %}
{% block language_switcher %}選擇語言{% endblock %}
{% block year_switcher %}選擇年度{% endblock %}

{% block home %}主頁{% endblock %}
{% block table_of_contents_title %}目錄{% endblock %}
{% block contributors_title %}貢獻者{% endblock %}
{% block methodology_title %}統計方法{% endblock %}

{% block part %}部分{% endblock %}
{% block chapter %}章{% endblock %}

{% block start_exploring %}開始探索{% endblock %}

{% block menu_title %}頁面目錄{% endblock %}
{% block open_the_menu %}開啟頁面目錄{% endblock %}
{% block close_the_menu %}關閉頁面目錄{% endblock %}

{% block index_nav_title %}章節目錄{% endblock %}
{% block index_title %}索引{% endblock %}
{% block open_the_index %}開啟章節目錄Open the Table of Contents{% endblock %}
{% block close_the_index %}關閉章節目錄Close the Table of Contents{% endblock %}

{% block and %}和{% endblock %}
{% block comma %}, {% endblock %}

{% block open %}開啟{% endblock %}
{% block close %}關閉{% endblock %}

{% macro figure_text(metadata, id) %}圖表 {{ figure_id(metadata, id) }}.{% endmacro %}
{% macro show_description(metadata, id) %}顯示圖表說明 {{ figure_id(metadata, id) }}{% endmacro %}
{% macro hide_description(metadata, id) %}隱藏圖表說明 {{ figure_id(metadata, id) }}{% endmacro %}

{% block written_by_before %}作者:{% endblock %}
{% block reviewed_by_before %}審稿者:{% endblock %}
{% block translated_by_before %}翻譯者:{% endblock %}
{% block analysis_by_before %}分析者:{% endblock %}
{% block written_by_after %}{% endblock %}
{% block reviewed_by_after %}{% endblock %}
{% block translated_by_after %}{% endblock %}
{% block analysis_by_after %}{% endblock %}

{% block author %}作者{% endblock %}
{% block authors %}作者{% endblock %}

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} Twitter{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} 網站{% endmacro %}

{% macro edition(year) %}{{ year }} 版{% endmacro %}

{% block footer_title %}註腳導覽{% endblock %}
{% block copyright %}© Web Almanac. 版權聲明 <a href="https://github.com/HTTPArchive/almanac.httparchive.org/blob/main/LICENSE">Apache 2.0</a>.{% endblock %}
{% block accessibility_statement %}無障礙網頁聲明{% endblock %}

{% block featured_chapter %}章節精選{% endblock %}

{# Check if read_chapter already defined in child template as macros can't be overridden #}
{% if not read_chapter %}
{% macro read_chapter(chapter) %}閱讀 <span class="featured-chapter-name">{{ chapter }}</span> 章節{% endmacro %}
{% endif %}

{% block contributors_description %}
Web Almanac 網路年鑑是被熱情的網路社群擁抱而茁壯。 {{ self.contributors() }} 團隊成員志願挹注難以計數的泉源在規劃、研究、撰寫、發佈的各個階段。
{% endblock %}
{% block contributors_link %}認識貢獻者{% endblock %}

{% block methodology_stat_1_title %}網站測試數量{% endblock %}
{% block methodology_stat_1 %}5.8 百萬{% endblock %}
{% block methodology_stat_2_title %}數據處理數量Data Processed{% endblock %}
{% block methodology_stat_2 %}20.9 兆位元組{% endblock %}
{% block methodology_description %}
除另有備註外,Web Almanac 網路年鑑20個章節的統計指標皆萃取自HTTP Archive數據集。HTTP Archive是社群推動的專案,自2010年開始持續追蹤網路如何建置,每月透過WebPageTest和Lighthouse測試將近6百萬個網站並將資料集公開置於BigQuery供眾分析。Web Almanac網路年鑑的統計指標採用2019年7月的數據集為基準,更多的資訊請參閱統計方法頁面。
{% endblock %}
{% block methodology_link %}瞭解統計方法{% endblock %}

{% block introduction %}介紹{% endblock %}

{% block foreword_title %}前言{% endblock %}

{% block foreword %}
<p>
當你踏進科技網絡世界後會發現開放的網路是如此撲朔迷離的美麗,透過緊密相連的網路生態系統讓擁抱網路的產業與職業共創成功。我們瞭解網路很重要,但卻難以捉摸網路究竟如何運行。自從2010年,HTTP Archive啟動這個迷人的專案,開始持續追蹤網路如何建構。然而還有一件使命深深吸引著Web Almanac網路年鑑的挑戰:賦予這些數據集生命力並促使社群能更容易瞭解網路如何運行,這也是Web Almanac網路年鑑熱情傳播的所在。
</p>

<p>
Web Almanac網路年鑑的任務是將原本只有數據挖礦勇者才能發掘的寶藏公諸大眾並將其整理為簡單易懂的年鑑,這是產業專家們熱情的挹注才讓數據重燃生命展現脈絡。Web Almanac的20個章節分別展現網路的各種脈絡,其由各個領域的專家作者撰寫後再由夥伴互相審稿後誕生,Web Almanac網路年鑑的養分是由撰寫撫育它茁壯的專家的經驗知識堆疊。
</p>

<p>
Web Almanac網路年鑑收穫許多值得慶祝的里程碑,但它也提醒我們要更精益求的推動高品質的使用者體驗。透過各個章節的數據脈絡分析讓我們更勇於承擔使命,並分享如何開發更好的網路。這就像是為迷途羞愧的羔羊點燃熊熊烈火指引明亮的康莊大道,透過網路社群不斷挹注養分的推動下,我們希望將統計年鑑視為年度傳統,讓每年度能視需要追蹤進度,並重燃照耀康莊大道。
</p>

<p>
你將會發現這本年鑑有許多值得學習的地方,現在就啟程探索並向社群分享你的想法,這將讓我們可以瞭解使用者閱讀網路年鑑的體驗。
</p>

<p>— <em><a href="{{ url_for('contributors', year=year, lang=lang, _anchor='rviscomi') }}">Rick Viscomi</a>, Web Almanac 創辦者</em></p>
{% endblock %}

{% block coming_soon %}即將來到!{% endblock %}

{% block appendix %}附錄{% endblock %}
{% block appendices %}附錄{% endblock %}

{% block ebook_title %}電子書{% endblock %}
{% block ebook_download %}下載 {{ year }} Web Almanac 網路年鑑: PDF 格式 ({{ ebook_size_in_mb }}MB){% endblock %}
{% block ebook_download_note %}(使用 <a href="https://www.princexml.com/">www.princexml.com</a>){% endblock %}

{%
set localizedPartTitles = {
"I. Page Content": "I. 頁面內容",
"II. User Experience": "II. 使用者體驗",
"III. Content Publishing": "III. 內容發布",
"IV. Content Distribution": "IV. 內容傳遞"
}
%}
{%
set localizedChapterTitles = {
"javascript": "JavaScript",
"css": "CSS",
"markup": "標記",
"media": "媒體",
"third-parties": "第三方",
"fonts": "字體",
"performance": "效能",
"security": "安全",
"accessibility": "無障礙網頁",
"seo": "搜尋引擎優化",
"pwa": "漸進式網頁應用程式",
"mobile-web": "行動裝置網頁",
"ecommerce": "電子商務",
"cms": "內容管理系統",
"compression": "壓縮",
"caching": "緩存",
"cdn": "內容傳遞網路",
"page-weight": "網頁大小",
"resource-hints": "資源提示",
"http2": "超文字傳輸協定/第2版",
"privacy": "隱私",
"capabilities": "功能",
"jamstack": "Jamstack"
}
%}

{% set localizedTeamNames = {
"analysts": "分析者",
"authors": "作者",
"brainstormers": "腦力激盪者",
"designers": "設計者",
"developers": "開發者",
"editors": "審稿者",
"leads": "專案主導者",
"reviewers": "審稿者",
"translators": "翻譯者",
}
%}
20 changes: 20 additions & 0 deletions src/templates/zh-CHT/2019/base_chapter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "base/2019/base_chapter.html" %}

{% block title %}{{ metadata.get('title') }} | 2019 | Web Almanac 精粹自 HTTP Archive{% endblock %}

{% block description %}{{ metadata.get('description',metadata.get('title') + ' 章節 ' + year + ' Web Almanac 探索使用狀況 ' + metadata.get('description',metadata.get('title')) + ' 在網路中。') }}{% endblock %}

{% block twitter_image_alt %}圖片 {{ metadata.get('title') }} 章節 {{ year }} Web Almanac{% endblock %}

{% block unedited %}[Unedited]{% endblock %}

{% block prev_next_title %}上章節和下章節導航{% endblock %}

{% block discuss_this_chapter %}討論本章節{% endblock %}
{% block comment %}評論{% endblock %}
{% block comments %}評論{% endblock %}
{% block queries %}查看查詢{% endblock %}
{% block results %}查看結果{% endblock %}

{% block previous %}上章節 (按 'p' 或 ','){% endblock %}
{% block next %}下章節 (按 'n' 或 '.'){% endblock %}
17 changes: 17 additions & 0 deletions src/templates/zh-CHT/2019/base_ebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "base/2019/base_ebook.html" %}

{% block title %} {{ year }} Web Almanac 精粹自 HTTP Archive{% endblock %}

{% block date_published %}2020-05-10T12:00:00.000Z{% endblock %}
{% block date_modified %}2020-07-20T00:00:00.000Z{% endblock %}

{% block intro_title %}<span class="intro-year">{{ year }}</span><br>Web Almanac{% endblock %}
{% block intro_sub_title %}HTTP Archive 的年度<br><b>網路狀態</b> 報告{% endblock %}

{% block about_title %}關於 Web Almanac{% endblock %}

{% block description %}電子書版 {{ year }} Web Almanac{% endblock %}

{% block spine_title %}Web Almanac{% endblock %}

{% block twitter_image_alt %} {{ year }} Web Almanac{% endblock %}
14 changes: 14 additions & 0 deletions src/templates/zh-CHT/2019/contributors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base/2019/contributors.html" %}

{% block title %}2019 貢獻者 | Web Almanac 精粹自 HTTP Archive{% endblock %}

{% block description %} {{ config.contributors.items() | length }} Web Almanac 2019年的貢獻團隊有分析者、作者、腦力激盪者、設計者、開發者、編輯者、審稿者和翻譯者。{% endblock %}

{% block date_published %}2019-11-04T12:00:00.000Z{% endblock %}
{% block date_modified %}2020-07-17T00:00:00.000Z{% endblock %}

{% block filter_by_team %}按類組篩選: <span id="filtered-contributors">{{ self.contributors() }}</span><span id="contributors-total-text" class="hidden"> 的 <span id="contributors-total">{{ config.contributors.items() | length }}</span></span> 貢獻者。{% endblock %}
{% block filter_by %}篩選{% endblock %}

{% block join_the_team_title%}加入 Web Almanac 團隊{% endblock %}
{% block join_the_team_text%}加入團隊!{% endblock %}
27 changes: 27 additions & 0 deletions src/templates/zh-CHT/2019/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% extends "base/2019/error.html" %}

{% block date_published %}2019-11-04T12:00:00.000Z{% endblock %}
{% block date_modified %}2020-08-06T00:00:00.000Z{% endblock %}

{% block unknown_error %}未知錯誤{% endblock %}

{%
set localizedStatusCode = {
400: "錯誤的請求",
404: "找不到頁面",
500: "內部伺服器錯誤",
502: "短暫伺服器錯誤"
}
%}
{% macro expandedTitle(errorTitle) %}錯誤: {{ errorTitle }}{% endmacro %}
{%
set localizedErrorMessage = {
"Unsupported year requested": "不支援的年度請求",
"Unsupported chapter requested": "不支援的章節請求",
"Unsupported language requested": "不支援的語言請求",
"Not Found": "伺服器上找不到您的網址請求,若手動輸入請再檢查拼寫後重試。"
}
%}
{% macro expandedErrorMessage(errorCode, errorDescription, errorMessage) %}
{{ errorCode }} {{ errorDescription }}: {{ errorMessage }}
{% endmacro %}
12 changes: 12 additions & 0 deletions src/templates/zh-CHT/2019/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "base/2019/index.html" %}

{% block title %} {{ year }} Web Almanac{% endblock %}
{% block description %}Web Almanac 網路年鑑是網路狀態的年度報告,其集結網路社群的專業知識共同精萃HTTP Archive的數據與趨勢。{% endblock %}

{% block twitter_image_alt %} {{ year }} Web Almanac{% endblock %}

{% block date_published %}2019-11-04T12:00:00.000Z{% endblock %}
{% block date_modified %}2020-06-21T00:00:00.000Z{% endblock %}

{% block intro_title %}Web Almanac{% endblock %}
{% block intro_sub_title %}HTTP Archive 網路年鑑是年度<br> <b>網路狀態的</b> 報告{% endblock %}
10 changes: 10 additions & 0 deletions src/templates/zh-CHT/2019/table_of_contents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base/2019/table_of_contents.html" %}

{% block title %}目錄 | Web Almanac 2019{% endblock %}

{% block description %}Web Almanac 網路年鑑2019年列出以下章節:頁面內容、使用者體驗、內容發布、內容傳遞。{% endblock %}

{% block twitter_image_alt %}{{ year }} Web Almanac 網路年鑑的統計方法{% endblock %}

{% block date_published %}2019-11-04T12:00:00.000Z{% endblock %}
{% block date_modified %}2020-06-21T00:00:00.000Z{% endblock %}
13 changes: 13 additions & 0 deletions src/templates/zh-CHT/2020/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "%s/2019/base.html" % lang %}

{% block featured_chapter %}精選章節<br/>從 2019 Web Almanac{% endblock %}
{% macro read_chapter(chapter) %}閱讀 2019 <span class="featured-chapter-name">{{ chapter }}</span> 章節{% endmacro %}

{% block methodology_stat_1 %}7.5百萬{% endblock %}
{% block methodology_stat_2 %}31.3 兆位元組{% endblock %}
{% block methodology_description %}
除另有備註外,Web Almanac 網路年鑑22個章節的統計指標皆萃取自HTTP Archive數據集。HTTP Archive是社群推動的專案,自2010年開始持續追蹤網路如何建置,每月透過WebPageTest和Lighthouse測試將近7.5百萬個網站並將資料集公開置於BigQuery供眾分析。Web Almanac網路年鑑的統計指標採用2020年8月的數據集為基準,更多的資訊請參閱統計方法頁面。
{% endblock %}

{% block foreword %}
{% endblock %}
14 changes: 14 additions & 0 deletions src/templates/zh-CHT/2020/contributors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base/2019/contributors.html" %}

{% block title %}{{ year }} 貢獻者 | Web Almanac 精粹自 HTTP Archive{% endblock %}

{% block description %} {{ config.contributors.items() | length }} 團隊成員貢獻 {{ year }} Web Almanac 有分析者、作者、腦力激盪者、設計者、開發者、編輯者、審稿者和翻譯者。{% endblock %}

{% block date_published %}2020-07-14T00:00:00.000Z{% endblock %}
{% block date_modified %}2020-11-03T00:00:00.000Z{% endblock %}

{% block filter_by_team %}按類組篩選: <span id="filtered-contributors">{{ self.contributors() }}</span><span id="contributors-total-text" class="hidden"> 的 <span id="contributors-total">{{ config.contributors.items() | length }}</span></span> 貢獻者。{% endblock %}
{% block filter_by %}篩選{% endblock %}

{% block join_the_team_title%}加入 Web Almanac 團隊{% endblock %}
{% block join_the_team_text%}加入團隊!{% endblock %}
18 changes: 18 additions & 0 deletions src/templates/zh-CHT/2020/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base/2019/index.html" %}

{% block title %}The {{ year }} Web Almanac{% endblock %}
{% block description %}Web Almanac 網路年鑑是網路狀態的年度報告,其集結網路社群的專業知識共同精萃HTTP Archive的數據與趨勢。{% endblock %}

{% block twitter_image_alt %} {{ year }} Web Almanac{% endblock %}

{% block date_published %}2020-07-06T00:00:00.000Z{% endblock %}
{% block date_modified %}2020-11-03T00:00:00.000Z{% endblock %}

{% block intro_title %}{{ self.coming_soon() }}{% endblock %}
{% block intro_sub_title %} {{ year }} <b>網路狀態的</b> 報告{% endblock %}

{% block mission %}
<p>
網路社群的專家目前正如火如荼地籌備、分析、撰寫各章節於 {{ year }} Web Almanac版本,預計將在年底前發布。
</p>
{% endblock %}
2 changes: 1 addition & 1 deletion src/tools/scripts/set_lighthouse_urls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ elif [ "${RUN_TYPE}" == "pull_request" ] && [ "${COMMIT_SHA}" != "" ]; then
git pull --quiet
git checkout main
# Then get the changes
CHANGED_FILES=$(git diff --name-only "main...${COMMIT_SHA}" --diff-filter=d content templates | grep -v base.html | grep -v ejs | grep -v base_ | grep -v toc.html | grep -v sitemap)
CHANGED_FILES=$(git diff --name-only "main...${COMMIT_SHA}" --diff-filter=d content templates | grep -v base.html | grep -v ejs | grep -v base_ | grep -v toc.html | grep -v sitemap | grep -v error.html)
# Then back to the pull request changes
git checkout --progress --force "${COMMIT_SHA}"

Expand Down