Example #1
0
  Tracker.autorun(function () {
    const language = TAPi18n.getLanguage()

    // Change html attribute
    $('html').attr('lang', language)

    // Change moment.js locale
    moment.locale(language)
  })
Example #2
0
import { Template } from 'meteor/templating';
import { TAPi18n } from 'meteor/tap:i18n';

import '/imports/ui/components/navbar-main.js';

import './settings.html';


Template.Settings_page.helpers({
  languages() {
    var currentLang = TAPi18n.getLanguage();
    var langs = TAPi18n.getLanguages();
    var key;
    var lang;
    var langsArray = [];
    for (key in langs) {
      lang = langs[key];
      lang._id = key;
      if (key === currentLang) {
        lang.selected = true;
      }
      langsArray.push(lang);
    }
    return langsArray;
  }
});


Template.Settings_page.onRendered(function(){

  var instance = Template.instance();
Example #3
0
export function formatDate (date, dateFormat = 'LL') {
  // Get current language
  const language = TAPi18n.getLanguage();
  // Return formatted date
  return moment(date).locale(language).format(dateFormat);
}
Example #4
0
	getExcelDownloadHref: function () {
		return "/server/generateExcelFile/" + Router.current().params.quizName + "/" + TAPi18n.getLanguage() + "/" + localData.getPrivateKey() ;
	},