diff --git a/js/app/Messages.js b/js/app/Messages.js index ed41d70..a6f79db 100644 --- a/js/app/Messages.js +++ b/js/app/Messages.js @@ -3,4 +3,19 @@ var Polyglot = require( 'node-polyglot' ), i18n = require( '../i18n.json' ); -module.exports = new Polyglot( { phrases: i18n[ 'de' ] } ); +var getParam = function getUrlParameter(sParam) { + var sPageURL = decodeURIComponent(window.location.search.substring(1)), + sURLVariables = sPageURL.split('&'), + sParameterName, + i; + + for (i = 0; i < sURLVariables.length; i++) { + sParameterName = sURLVariables[i].split('='); + + if (sParameterName[0] === sParam) { + return sParameterName[1] === undefined ? true : sParameterName[1]; + } + } +}; + +module.exports = new Polyglot( { phrases: i18n[ getParam('lang') ] } );