提交 f3e697fc 编写于 作者: M Mr.doob

Docs: Automatically set language from hash.

上级 4efa1be7
......@@ -54,17 +54,29 @@
var hash = window.location.hash.substring( 1 );
// Route non-localised api links
// Localisation
var language = 'en';
if ( /^(api|manual)/.test( hash ) ) {
if ( /^(api|manual)/.test( hash ) && /^(api|manual)\/(en|zh)\//.test( hash ) === false ) {
var hashLanguage = /^(api|manual)\/(en|zh)\//.exec( hash );
if ( hashLanguage === null ) {
// Route old non-localised api links
window.location.hash = hash.replace( /^(api|manual)/, '$1/en' );
} else {
language = hashLanguage[ 2 ];
}
//
}
var language = 'en';
//
function setLanguage( value ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册