if(document.referrer==='' && window.location.pathname=='/') { var getBrowserLanguages = function () { var nav = window.navigator, browserLanguagePropertyKeys = ['language', 'browserLanguage', 'systemLanguage', 'userLanguage'], i, language; // support for HTML 5.1 "navigator.languages" if (Array.isArray(nav.languages)) { return nav.languages; } // support for other well known properties in browsers for (i = 0; i < browserLanguagePropertyKeys.length; i++) { language = nav[browserLanguagePropertyKeys[i]]; if (language && language.length) { return new Array(language); } } return null; }; var redirect = function() { var browserLanguages = getBrowserLanguages(); //console.log( 'browserLanguages',browserLanguages ); if (typeof browserLanguages !== 'undefined' && browserLanguages.length > 0) { var idiomas_soportados = ['en','fr','ru']; var idioma_original = 'es'; var idioma_alternativo = 'en'; //console.log('idiomas_soportados',idiomas_soportados); //console.log('idioma_original',idioma_original); var i; for (i = 0; i < browserLanguages.length; ++i) { var lang = browserLanguages[i].substring(0, 2); if(lang == idioma_original) { //console.log('nada '+lang); return; } else if( idiomas_soportados.indexOf(lang) != -1 ) { //console.log("window.location.replace( '/'+lang+'/' ) "); window.location.replace( '/'+lang+'/' ); return; } else { //console.log(' '+lang); } } } window.location.replace( '/'+idioma_alternativo+'/' ); return } redirect(); }

gayafores декорирование

gayafores декорирование

Volver arriba