Browse Source

Docs: Added localisation support to manual pages.

Mr.doob 7 years ago
parent
commit
3c46c06a20

+ 2 - 2
docs/index.html

@@ -36,9 +36,9 @@
 
 			// Route non-localised api links
 
-			if ( /^api/.test( hash ) && /^api\/(en|zh)\//.test( hash ) === false ) {
+			if ( /^(api|manual)/.test( hash ) && /^(api|manual)\/(en|zh)\//.test( hash ) === false ) {
 
-				window.location.hash = hash.replace( /^api/, 'api/en' );
+				window.location.hash = hash.replace( /^(api|manual)/, '$1/en' );
 
 			}
 

+ 16 - 16
docs/list.js

@@ -3,28 +3,28 @@ var list = {
 	"Manual": {
 
 		"Getting Started": {
-			"Creating a scene": "manual/introduction/Creating-a-scene",
-			"Import via modules": "manual/introduction/Import-via-modules",
-			"Browser support": "manual/introduction/Browser-support",
-			"WebGL compatibility check": "manual/introduction/WebGL-compatibility-check",
-			"How to run things locally": "manual/introduction/How-to-run-things-locally",
-			"Drawing lines": "manual/introduction/Drawing-lines",
-			"Creating text": "manual/introduction/Creating-text",
-			"Loading 3D models": "manual/introduction/Loading-3D-models",
-			"Migration guide": "manual/introduction/Migration-guide",
-			"Code style guide": "manual/introduction/Code-style-guide",
-			"FAQ": "manual/introduction/FAQ",
-			"Useful links": "manual/introduction/Useful-links"
+			"Creating a scene": "manual/{lan}/introduction/Creating-a-scene",
+			"Import via modules": "manual/{lan}/introduction/Import-via-modules",
+			"Browser support": "manual/{lan}/introduction/Browser-support",
+			"WebGL compatibility check": "manual/{lan}/introduction/WebGL-compatibility-check",
+			"How to run things locally": "manual/{lan}/introduction/How-to-run-things-locally",
+			"Drawing lines": "manual/{lan}/introduction/Drawing-lines",
+			"Creating text": "manual/{lan}/introduction/Creating-text",
+			"Loading 3D models": "manual/{lan}/introduction/Loading-3D-models",
+			"Migration guide": "manual/{lan}/introduction/Migration-guide",
+			"Code style guide": "manual/{lan}/introduction/Code-style-guide",
+			"FAQ": "manual/{lan}/introduction/FAQ",
+			"Useful links": "manual/{lan}/introduction/Useful-links"
 		},
 
 		"Next Steps": {
-			"How to update things": "manual/introduction/How-to-update-things",
-			"Matrix transformations": "manual/introduction/Matrix-transformations",
-			"Animation system": "manual/introduction/Animation-system"
+			"How to update things": "manual/{lan}/introduction/How-to-update-things",
+			"Matrix transformations": "manual/{lan}/introduction/Matrix-transformations",
+			"Animation system": "manual/{lan}/introduction/Animation-system"
 		},
 
 		"Build Tools": {
-			"Testing with NPM": "manual/buildTools/Testing-with-NPM"
+			"Testing with NPM": "manual/{lan}/buildTools/Testing-with-NPM"
 		}
 
 	},

+ 1 - 1
docs/manual/buildTools/Testing-with-NPM.html → docs/manual/en/buildTools/Testing-with-NPM.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Animation-system.html → docs/manual/en/introduction/Animation-system.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8" />
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Browser-support.html → docs/manual/en/introduction/Browser-support.html

@@ -2,7 +2,7 @@
 <html lang="en">
 <head>
 	<meta charset="utf-8">
-	<base href="../../" />
+	<base href="../../../" />
 	<script src="list.js"></script>
 	<script src="page.js"></script>
 	<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Code-style-guide.html → docs/manual/en/introduction/Code-style-guide.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Creating-a-scene.html → docs/manual/en/introduction/Creating-a-scene.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Creating-text.html → docs/manual/en/introduction/Creating-text.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Drawing-lines.html → docs/manual/en/introduction/Drawing-lines.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/FAQ.html → docs/manual/en/introduction/FAQ.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/How-to-run-things-locally.html → docs/manual/en/introduction/How-to-run-things-locally.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/How-to-update-things.html → docs/manual/en/introduction/How-to-update-things.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Import-via-modules.html → docs/manual/en/introduction/Import-via-modules.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Loading-3D-models.html → docs/manual/en/introduction/Loading-3D-models.html

@@ -3,7 +3,7 @@
 
 <head>
   <meta charset="utf-8">
-  <base href="../../" />
+  <base href="../../../" />
   <script src="list.js"></script>
   <script src="page.js"></script>
   <link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Matrix-transformations.html → docs/manual/en/introduction/Matrix-transformations.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Migration-guide.html → docs/manual/en/introduction/Migration-guide.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/Useful-links.html → docs/manual/en/introduction/Useful-links.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />

+ 1 - 1
docs/manual/introduction/WebGL-compatibility-check.html → docs/manual/en/introduction/WebGL-compatibility-check.html

@@ -2,7 +2,7 @@
 <html lang="en">
 	<head>
 		<meta charset="utf-8">
-		<base href="../../" />
+		<base href="../../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
 		<link type="text/css" rel="stylesheet" href="page.css" />