Skip to content

Commit 5a415f8

Browse files
authored
Merge pull request #14755 from mrdoob/docs
Docs: Added localisation support to manual pages.
2 parents e1cd737 + 3c46c06 commit 5a415f8

18 files changed

+34
-34
lines changed

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ <h1><a href="http://threejs.org">three.js</a> / docs</h1>
3636

3737
// Route non-localised api links
3838

39-
if ( /^api/.test( hash ) && /^api\/(en|zh)\//.test( hash ) === false ) {
39+
if ( /^(api|manual)/.test( hash ) && /^(api|manual)\/(en|zh)\//.test( hash ) === false ) {
4040

41-
window.location.hash = hash.replace( /^api/, 'api/en' );
41+
window.location.hash = hash.replace( /^(api|manual)/, '$1/en' );
4242

4343
}
4444

docs/list.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ var list = {
33
"Manual": {
44

55
"Getting Started": {
6-
"Creating a scene": "manual/introduction/Creating-a-scene",
7-
"Import via modules": "manual/introduction/Import-via-modules",
8-
"Browser support": "manual/introduction/Browser-support",
9-
"WebGL compatibility check": "manual/introduction/WebGL-compatibility-check",
10-
"How to run things locally": "manual/introduction/How-to-run-things-locally",
11-
"Drawing lines": "manual/introduction/Drawing-lines",
12-
"Creating text": "manual/introduction/Creating-text",
13-
"Loading 3D models": "manual/introduction/Loading-3D-models",
14-
"Migration guide": "manual/introduction/Migration-guide",
15-
"Code style guide": "manual/introduction/Code-style-guide",
16-
"FAQ": "manual/introduction/FAQ",
17-
"Useful links": "manual/introduction/Useful-links"
6+
"Creating a scene": "manual/{lan}/introduction/Creating-a-scene",
7+
"Import via modules": "manual/{lan}/introduction/Import-via-modules",
8+
"Browser support": "manual/{lan}/introduction/Browser-support",
9+
"WebGL compatibility check": "manual/{lan}/introduction/WebGL-compatibility-check",
10+
"How to run things locally": "manual/{lan}/introduction/How-to-run-things-locally",
11+
"Drawing lines": "manual/{lan}/introduction/Drawing-lines",
12+
"Creating text": "manual/{lan}/introduction/Creating-text",
13+
"Loading 3D models": "manual/{lan}/introduction/Loading-3D-models",
14+
"Migration guide": "manual/{lan}/introduction/Migration-guide",
15+
"Code style guide": "manual/{lan}/introduction/Code-style-guide",
16+
"FAQ": "manual/{lan}/introduction/FAQ",
17+
"Useful links": "manual/{lan}/introduction/Useful-links"
1818
},
1919

2020
"Next Steps": {
21-
"How to update things": "manual/introduction/How-to-update-things",
22-
"Matrix transformations": "manual/introduction/Matrix-transformations",
23-
"Animation system": "manual/introduction/Animation-system"
21+
"How to update things": "manual/{lan}/introduction/How-to-update-things",
22+
"Matrix transformations": "manual/{lan}/introduction/Matrix-transformations",
23+
"Animation system": "manual/{lan}/introduction/Animation-system"
2424
},
2525

2626
"Build Tools": {
27-
"Testing with NPM": "manual/buildTools/Testing-with-NPM"
27+
"Testing with NPM": "manual/{lan}/buildTools/Testing-with-NPM"
2828
}
2929

3030
},

docs/manual/buildTools/Testing-with-NPM.html renamed to docs/manual/en/buildTools/Testing-with-NPM.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Animation-system.html renamed to docs/manual/en/introduction/Animation-system.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Browser-support.html renamed to docs/manual/en/introduction/Browser-support.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Code-style-guide.html renamed to docs/manual/en/introduction/Code-style-guide.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Creating-a-scene.html renamed to docs/manual/en/introduction/Creating-a-scene.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Creating-text.html renamed to docs/manual/en/introduction/Creating-text.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/Drawing-lines.html renamed to docs/manual/en/introduction/Drawing-lines.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

docs/manual/introduction/FAQ.html renamed to docs/manual/en/introduction/FAQ.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<base href="../../" />
5+
<base href="../../../" />
66
<script src="list.js"></script>
77
<script src="page.js"></script>
88
<link type="text/css" rel="stylesheet" href="page.css" />

0 commit comments

Comments
 (0)