function onLanguageChanged(lang){
        lang = lang || i18next.language || 'en';

        //Check if moment has the same language
        if ((moment.locale() != lang) && (moment.locales().indexOf(lang) > -1))
            moment.locale(lang);

        //Set name of month, weekday etc.
        ns.setOptions({
            lang: {
                months       : moment.months(),
                shortMonths  : moment.monthsShort(),
                shortWeekdays: moment.weekdaysShort(),
                weekdays     : moment.weekdays() //= 3 char. Alt: moment.weekdaysMin() = 2 char
            }
        }, true);
    }
/**************************************************************
    1: onLanguageChanged - Called when i18next changes language: Change names of month and weekdays
    ***************************************************************/
Called when i18next changes language: Change names of month and weekdays
Called when i18next changes language : Change names of month and weekdays
function onLanguageChanged(lang){
        lang = lang || i18next.language || 'en';
        if ((moment.locale() != lang) && (moment.locales().indexOf(lang) > -1))
            moment.locale(lang);
        ns.setOptions({
            lang: {
                months       : moment.months(),
                shortMonths  : moment.monthsShort(),
                shortWeekdays: moment.weekdaysShort(),
                weekdays     : moment.weekdays() 
            }
        }, true);
    }
function onLanguageChanged ( lang ) { lang = lang || i18next . language || 'en' ; if ( ( moment . locale ( ) != lang ) && ( moment . locales ( ) . indexOf ( lang ) > - 1 ) ) moment . locale ( lang ) ; ns . setOptions ( { lang : { months : moment . months ( ) , shortMonths : moment . monthsShort ( ) , shortWeekdays : moment . weekdaysShort ( ) , weekdays : moment . weekdays ( ) } } , true ) ; }
1: onLanguageChanged - Called when i18next changes language: Change names of month and weekdays
1 : onLanguageChanged - Called when i18next changes language : Change names of month and weekdays
//Check if moment has the same language //Set name of month, weekday etc. //= 3 char. Alt: moment.weekdaysMin() = 2 char