diff --git a/scripts/utils.js b/scripts/utils.js
index 830841b9..d2d6f73e 100644
--- a/scripts/utils.js
+++ b/scripts/utils.js
@@ -1,3 +1,5 @@
+// -*- mode: javascript; js-indent-offset: 2; -*-
+
if (typeof bd=="undefined") {
bd={};
}
@@ -24,7 +26,7 @@ bd.util.ajaxPost = function(url,params,callback, callbackError){
}
}
http.send(params);
-}
+};
bd.util.ajaxGet = function(url, callback, callbackError){
var xmlhttp;
@@ -46,7 +48,7 @@ bd.util.ajaxGet = function(url, callback, callbackError){
xmlhttp.open("GET",url,true);
xmlhttp.send();
-}
+};
bd.util.getURLParamValue = function(name){
@@ -59,4 +61,42 @@ bd.util.getURLParamValue = function(name){
} else {
return results[1];
}
-}
+};
+
+(function() {
+ if (window.location.search != "") {
+ var match = /[?&]locale=([^?&]*)/.exec(window.location.search);
+ if (match) {
+ var target = match[1].toLowerCase();
+ var parts = window.location.pathname.split('.');
+ if (parts.length == 2) {
+ if (target.indexOf('en') == 0) {
+ // Already at the English version
+ return;
+ }
+ parts.splice(1, 0, target);
+ } else if (parts.length == 3) {
+ if (parts[1] == target) {
+ // Already here
+ return;
+ } else if (target.indexOf('en') == 0) {
+ // English doesn't have a language tag in the name
+ parts.splice(1, 1);
+ } else {
+ parts[1] = match[1].toLowerCase();
+ }
+ } else {
+ return;
+ }
+ var newpath = parts.join('.');
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ window.location.pathname = newpath;
+ }
+ };
+ xhr.open('HEAD', newpath);
+ xhr.send();
+ }
+ }
+})();
diff --git a/yr/tutorials/markdown-tutorial.zh_cn.md b/yr/tutorials/markdown-tutorial.zh_cn.md
new file mode 100644
index 00000000..e3cae0ee
--- /dev/null
+++ b/yr/tutorials/markdown-tutorial.zh_cn.md
@@ -0,0 +1,155 @@
+---
+title: App Inventor教程创作
+layout: tutorial
+---
+
+# App Inventor教程创作
+
+## 介绍
+
+您可以使用Markdown编写App Inventor教程。 本文档简要介绍了如何使用Markdown创建教程。
+
+## 创建标题
+
+手风琴由1级标题组成。 您可以通过两种不同的方式进行指示:
+
+```markdown
+# 标头
+```
+
+要么
+
+```markdown
+标头
+===
+```
+
+## 创建教程页面
+
+通过在1级标题下创建2级标题来添加教程页面:
+
+```markdown
+# 标头
+
+## 第1页标题
+
+第1页内容
+
+## 第2页标题
+
+第2页内容
+```
+
+如果您喜欢标题的下划线方法,则可以使用`-`:
+
+```markdown
+标头
+===
+
+第1页标题
+---
+
+第1页内容
+
+第2页标题
+---
+
+第2页内容
+```
+
+## 添加方法
+
+对于包含有关连接随播广告的信息的教程,您可以使用此技术添加操作方法:
+
+```markdown
+# 连接到应用
+
+