Browse Source

Strip localization code from docs `[path]` template variable

Ford Hurley 7 years ago
parent
commit
a17a1228da
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':
 			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;
 
 		case 'examples':