Skip to content

Commit 0ec242d

Browse files
authored
Merge pull request #14846 from fordhurley/fix-docs-path
Strip localization code from docs `[path]` template variable
2 parents 2bdaaaa + a17a122 commit 0ec242d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/page.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ function onDocumentLoad( event ) {
3535

3636
case 'api':
3737
path = /\/api\/[A-z0-9\/]+/.exec( pathname ).toString().substr( 5 );
38+
39+
// Remove localized part of the path (e.g. 'en/' or 'es-MX/'):
40+
path = path.replace( /^[A-z0-9-]+\//, '' );
41+
3842
break;
3943

4044
case 'examples':

0 commit comments

Comments
 (0)