Browse Source

Merge pull request #14846 from fordhurley/fix-docs-path

Strip localization code from docs `[path]` template variable
Mr.doob 7 years ago
parent
commit
0ec242d956
1 changed files with 4 additions and 0 deletions
  1. 4 0
      docs/page.js

+ 4 - 0
docs/page.js

@@ -35,6 +35,10 @@ function onDocumentLoad( event ) {
 
 
 		case 'api':
 		case 'api':
 			path = /\/api\/[A-z0-9\/]+/.exec( pathname ).toString().substr( 5 );
 			path = /\/api\/[A-z0-9\/]+/.exec( pathname ).toString().substr( 5 );
+
+			// Remove localized part of the path (e.g. 'en/' or 'es-MX/'):
+			path = path.replace( /^[A-z0-9-]+\//, '' );
+
 			break;
 			break;
 
 
 		case 'examples':
 		case 'examples':