lang: function(params) {
   var locale = params.locale || 'en_US';
   Translation.setDefault(locale);
   localStore.set('lang', locale);
   this.viewManager.flush();
   stateModel.set('lang', locale);
   return this.redirect('/?lang={0}', [locale]);
 },
 var app = new BooksApplication(function () {
   // Initialize the routes
   this.router.add({
     '/': [BookController, 'index'],
     '/favorites' : [BookController, 'favorites']
   });
   stateModel.set('lang', localStore.get('lang') || 'en_US');
   //initialize translations
   Translation.init(stateModel.get('lang'));
   //render controls
   var modal = new ModalView('#modal');
   var menu = new MenuView('#menu');
 });
Example #3
0
 var app = new Application(function() {
   // Initialize the routes
   this.router.add({
     '/': [SearchController, 'home'],
     '/listings/{placeName}': [SearchController, 'listings'],
     '/listings/{placeName}/{guid}': [SearchController, 'listing'],
     '/favorites': [SearchController, 'favorites'],
     '/favorites/{guid}': [SearchController, 'listing']
   });
   stateModel.set('lang', localStore.get('lang') || 'en_US');
   //initialize translations
   Translation.init(stateModel.get('lang'));
   Detection.addCustomDetection(navigator.userAgent.search(/os 7_/i) > 0, 'iOS7', 'html');
   //render header view
   headerView.render();
 });
 userModel.signUp().then(function() {
   stateModel.set('user', Parse.User.current());
   router.exec('/');
 }, function(err) {
 onModelReset: function() {
   stateModel.set('pageTitle', this.model.get('pageTitle'));
   stateModel.trigger('reset');
   this.renderCells();
   this.render('.load-more');
 },