Add language detection

This commit is contained in:
SaintPeter
2016-02-09 20:57:23 -08:00
parent dd77f69ecb
commit ba18520845
7 changed files with 15 additions and 9 deletions

View File

@@ -382,8 +382,11 @@ $(document).ready(function() {
function showWiki() {
if (!main.isWikiAsideLoad) {
var lang = window.location.toString().match(/\/\w{2}\//);
lang = (lang) ? lang[0] : '/en/';
var wikiURL = 'http://freecodecamp.github.io/wiki' + lang;
var wikiAside = $('<iframe>');
wikiAside.attr('src', 'http://freecodecamp.github.io/wiki'); /* <----------------------------------------- here */
wikiAside.attr('src', wikiURL);
$('.wiki-aside').append(wikiAside);
main.isWikiAsideLoad = true;
}