Skip to content
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
3 changes: 2 additions & 1 deletion editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
<li><span title="Polish"><a lang="pl" href="#" class="action lang-choice" id="pl" tabindex="123">Polski</a></span></li>
<li><span title="Croatian"><a lang="hr" href="#" class="action lang-choice" id="hr" tabindex="124">Hrvatski</a></span></li>
<li><span title="Chinese (simplified)"><a lang="zh-CN" href="#" class="action lang-choice" id="zh-CN" tabindex="125">简体中文</a></span></li>
<li><span title="Chinese (Hong Kong)"><a lang="zh-HK" href="#" class="action lang-choice" id="zh-HK" tabindex="126">繁体中文</a></span></li>
<li><span title="Chinese (Hong Kong)"><a lang="zh-HK" href="#" class="action lang-choice" id="zh-HK" tabindex="126">中文 (繁體,香港)</a></span></li>
<li><span title="Chinese (Taiwan)"><a lang="zh-TW" href="#" class="action lang-choice" id="zh-TW" tabindex="127">中文(繁體,臺灣)</a></span></li>
</ul>
<div><a id="add-language-link" class="action" title="Add a language translation to the Editor" href="https://support.microbit.org/support/solutions/articles/19000106022-translating-the-micro-bit-python-editor" target="_blank" tabindex="129">Add a language</a></div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ var language = {
},
'zh-HK': {
'title': 'Chinese (traditional, Hong Kong)'
},
'zh-TW': {
'title': 'Chinese (traditional, Taiwan)'
}
},
'static-strings': {
Expand Down
3 changes: 3 additions & 0 deletions lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ var language = {
},
"zh-HK": {
"title": "Chinese (traditional, Hong Kong)"
},
"zh-TW": {
"title": "Chinese (traditional, Taiwan)"
}
},
"static-strings": {
Expand Down
3 changes: 3 additions & 0 deletions lang/hr.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ var language = {
},
"zh-HK": {
"title": "Kineski (tradicionalni, Hong Kong)"
},
"zh-TW": {
"title": "Chinese (traditional, Taiwan)"
}
},
"static-strings": {
Expand Down
5 changes: 4 additions & 1 deletion lang/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,13 @@ var language = {
"title": "Chorwacki"
},
"zh-CN": {
"title": "Chinese (simplified)"
"title": "Chiński (uproszczony)"
},
"zh-HK": {
"title": "Chinese (traditional, Hong Kong)"
},
"zh-TW": {
"title": "Chinese (traditional, Taiwan)"
}
},
"static-strings": {
Expand Down
3 changes: 3 additions & 0 deletions lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ var language = {
},
"zh-HK": {
"title": "Chinese (traditional, Hong Kong)"
},
"zh-TW": {
"title": "Chinese (traditional, Taiwan)"
}
},
"static-strings": {
Expand Down
5 changes: 4 additions & 1 deletion lang/zh-HK.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ var language = {
"title": "Chinese (simplified)"
},
"zh-HK": {
"title": "Chinese (traditional, Hong Kong)"
"title": "中文 (繁體,香港)"
},
"zh-TW": {
"title": "Chinese (traditional, Taiwan)"
}
},
"static-strings": {
Expand Down
227 changes: 227 additions & 0 deletions lang/zh-TW.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
var language = {
"code_snippets": {
"title": "程式碼片段",
"description": "程式碼片段(Code snippets)可以讓你在編程中快速使用代碼,這裡提供 MicroPython 裡最常見的一些。",
"instructions": "選取下面的一個程式碼片段,或者在編輯器中輸入觸發片語後按下 TAB 鍵。",
"trigger_heading": "觸發的片語",
"description_heading": "說明",
"docs": "為程式碼加上註解說明(documents)",
"wh": "只要(while)條件為 true 時就不斷持續做某些事",
"with": "給做某些事的內容分配一個名字",
"cl": "建立一個新的類別(class)用於定義新類型物件的行為",
"def": "定義一個已命名的函式,它需要一些參數並選擇性地添加描述",
"if": "如果(if)某種條件是 True 那麼就做點什麼",
"ei": "否則如果(else if)其他條件是 true 就做一些事",
"el": "否則(else)做一些其他的事",
"for": "在集合裡對每個(for each)項目都執行某項操作",
"try": "嘗試(try)做某事以處理異常或錯誤"
},
"share": {
"title": "分享程式",
"instructions": "使用密碼和提示(非必要,但可幫你回憶密碼)以建立一個能與他人共享程式的安全連結。",
"passphrase": "密碼: ",
"hint": "密碼提示: ",
"button": "建立連結",
"description": "此 URL 指向您的程式碼:",
"shortener": "這是短網址:"
},
"decrypt": {
"title": "解密原始程式碼",
"instructions": "輸入密碼以解密原始程式碼。",
"passphrase": "密碼: ",
"button": "解碼"
},
"alerts": {
"download": "在 Safari 上有個已知問題,你的工作將在被下載時會是一個未命名的檔案,請將它重新命名成以 .hex 結尾的檔案。另一個方法是改用 Firefox 或 Chrome 瀏覽器,它們不會發生這種問題。",
"save": "在 Safari 上有個已知問題,你的工作將在被下載時會是一個未命名的檔案,請將它重新命名成以 .py 結尾的檔案。另一個方法是改用 Firefox 或 Chrome 瀏覽器,它們不會發生這種問題。",
"load_code": "哎呀!無法將代碼載入到十六進位檔案中。",
"unrecognised_hex": "抱歉,我們無法識別這個檔案",
"snippets": "當 blockly 啟用時無法使用程式碼片段。",
"error": "錯誤:\n",
"empty": "這個 Python 檔案沒有任何內容。",
"no_python": "在 hex 檔中找不到有效的 Python 程式碼。",
"no_script": "Hex 檔的內容不包含 Python 腳本。",
"no_main": "Hex 檔沒有包含 main.py 檔案。",
"cant_add_file": "無法添加檔案到檔案系統:",
"module_added": "\"{{module_name}}\" 模組已添加到檔案系統。",
"module_out_of_space": "無法將檔案添加到系統,因為沒有多餘的儲存空間。"
},
"help": {
"docs-link": {
"title": "檢視 MicroPython 說明文件",
"label": "說明文件"
},
"support-link": {
"title": "以新頁籤開啟 micro:bit 支援中心",
"label": "支援"
},
"help-link": {
"title": "以新頁籤開啟此編輯器的幫助文件",
"label": "幫助"
},
"issues-link": {
"title": "在 GitHub 中檢視 Python 編輯器的未解決問題",
"label": "問題追蹤"
},
"feedback-link": {
"title": "給我們關於 Python 編輯器的回饋",
"label": "回饋意見"
},
"editor-ver": "編輯器版本:",
"mp-ver": "MicroPython 版本:"
},
"confirms": {
"quit": "有些內容變更後未儲存,確定要離開嗎?",
"blocks": "你有未儲存的程式。使用積木模式會更改你的代碼,你可能會遺失這些變更,確定要繼續嗎?",
"replace_main": "添加的 main.py 檔案將取代編輯器中現有的程式碼!",
"replace_file": "要取代 \"{{file_name}}\" 這個檔案嗎?",
"replace_module": "要取代 \"{{module_name}}\" 這個模組嗎?",
"download_py_multiple": "這個專案裡有多個不使用此格式保存的檔案。\n我們建議下載成 Hex 檔案,它將包含整個專案,也能在編輯器上重新讀取。\n\n確定只要下載 {{file_name}} 這個檔案?"
},
"code": {
"start": "在此處添加 Python 程式碼。例如:"
},
"webusb": {
"err": {
"update-req": "你需要<a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\">更新 micro:bit 韌體</a>以使用這個功能。",
"clear-connect": "另一個程序正在連線到這個設備。<br>關閉可能也在使用 WebUSB 的其它頁籤(像是 MakeCode、Python 編輯器),或者斷開 micro:bit 再重新連接。",
"reconnect-microbit": "請重新連接你的 micro:bit 後再試一次。",
"partial-flashing-disable": "如果錯誤仍然存在,請試著停用 Beta 選項中的快速燒錄功能。",
"device-disconnected": "設備已斷開連接。",
"timeout-error": "無法連接到 micro:bit",
"unavailable": "WebUSB 可以讓你直接在線上編輯器編程並連結序列埠監控台。<br/>可惜,這個瀏覽器不支援 WebUSB,建議你改用 Chrome 或是基於 Chrome 內核的其它瀏覽器。",
"find-more": "了解更多"
},
"troubleshoot": "疑難排解",
"close": "關閉",
"request-repl": "發送 CTRL-C 到 REPL",
"request-serial": "發送 CTRL-D 以重設",
"flashing-text": "燒錄 micro:bit",
"download": "下載 Hex 檔案"
},
"load": {
"show-files": "顯示檔案",
"load-title": "讀取",
"instructions": "拖曳一個 .hex 或 .py 檔案到這裡以開啟它。",
"submit": "讀取",
"save-title": "儲存",
"save-hex": "下載專案 Hex 檔案",
"save-py": "下載 Python 腳本",
"fs-title": "檔案",
"toggle-file": "或瀏覽裝置中的檔案。",
"fs-add-file": "新增檔案",
"hide-files": "隱藏檔案",
"td-filename": "檔案名稱",
"td-size": "大小",
"fs-space-free": "可用空間",
"remove-but": "移除",
"save-but": "儲存",
"files-title": "專案檔案",
"help-button": "檔案説明",
"file-help-text": "專案檔案區域顯示程式中引用(include)的檔案,並允許你添加或移除外部 python 模組和其它檔案。要進一步瞭解請參閱",
"help-link": "Python 編輯器幫助文件",
"invalid-file-title": "無效的檔案類型",
"mpy-warning": "這個版本的 Python 編輯器還不支援添加 .mpy 檔案。",
"extension-warning": "Python 編輯器只能載入副檔名為 .hex 或 .py 的檔案。"
},
"languages": {
"en": {
"title": "英文"
},
"es": {
"title": "西班牙语"
},
"pl": {
"title": "波蘭語"
},
"hr": {
"title": "克羅地亞語"
},
"zh-CN": {
"title": "中文(簡體)"
},
"zh-HK": {
"title": "中文(繁體,香港)"
},
"zh-TW": {
"title": "中文(繁體,臺灣)"
}
},
"static-strings": {
"buttons": {
"command-download": {
"title": "下載一個 hex 檔案以燒錄到 micro:bit 上",
"label": "下載"
},
"command-disconnect": {
"title": "斷開 micro:bit 連線",
"label": "中斷連線"
},
"command-flash": {
"title": "直接將專案燒錄到 micro:bit",
"label": "燒錄"
},
"command-files": {
"title": "讀取/儲存檔案",
"label": "讀取/儲存"
},
"command-serial": {
"title": "通過序列埠連接 micro:bit",
"label": "開啟序列埠",
"title-close": "關閉序列埠連線並返回編輯器",
"label-close": "關閉序列埠"
},
"command-connect": {
"title": "連線到 micro:bit",
"label": "連線"
},
"command-connecting": {
"title": "正在連線到 micro:bit",
"label": "正在連線"
},
"command-options": {
"title": "變更編輯器設定",
"label": "Beta 選項"
},
"command-blockly": {
"title": "點擊以 blockly 建立程式碼",
"label": "Blockly"
},
"command-snippet": {
"title": "點擊以選擇一個片語(快捷代碼)",
"label": "程式碼片段"
},
"command-help": {
"title": "探索有用的資源",
"label": "幫助"
},
"command-language": {
"title": "選取語言",
"label": "語言"
},
"command-share": {
"title": "建立一個連結共享你的腳本",
"label": "分享"
},
"command-zoom-in": {
"title": "放大"
},
"command-zoom-out": {
"title": "縮小"
}
},
"script-name": {
"label": "腳本名稱"
},
"options-dropdown": {
"autocomplete": "自動完成",
"on-enter": "按 [Enter] 後",
"partial-flashing": "快速燒錄",
"lang-select": "選擇語言:",
"add-language-link": "新增語言"
},
"text-editor": {
"aria-label": "文字編輯器"
}
}
};
2 changes: 1 addition & 1 deletion python-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function translations() {
'use strict';
// These values must be valid language codes
// https://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
var validLangs = ['en', 'es', 'pl', 'hr', 'zh-HK', 'zh-CN'];
var validLangs = ['en', 'es', 'pl', 'hr', 'zh-HK', 'zh-CN', 'zh-TW'];

/* Replaces DOM script element with the new language js file. */
function updateLang(newLang, callback) {
Expand Down