diff --git a/_includes/languages.html b/_includes/languages.html
index 9bb55f3e..2c44f118 100644
--- a/_includes/languages.html
+++ b/_includes/languages.html
@@ -25,11 +25,10 @@
count = opts.length;
for ( var i = 0; i < count; i++ ){
- if ( -1 === opts[ i ].value.indexOf( window.location.pathname ) ) {
- continue;
+ // Only happens if you have language path on the start of the location.pathname
+ if ( 0 === window.location.pathname.indexOf( opts[ i ].value ) ) {
+ opts[ i ].setAttribute( 'selected', 'selected' );
}
-
- opts[ i ].setAttribute( 'selected', 'selected' );
}
} )();