<commit_before>import Vue from 'vue';
import Router from 'vue-router';
import Lockr from 'lockr';
import Routes from "./Routes";
import EventBus from "../components/Framework/Events/EventBus";

import Account from './account';
import Art from './art';
import Static from './static';
import Home from './home';
import Configuration from './configuration';
import Maintenance from './maintenance';
import MyJinya from './myjinya';
import Events from "../components/Framework/Events/Events";

const routes = Home
  .concat(Account)
  .concat(Art)
  .concat(Static)
  .concat(Configuration)
  .concat(Maintenance)
  .concat(MyJinya);

Vue.use(Router);

const router = new Router({
  mode: 'history',
  routes: routes
});

router.beforeEach((to, from, next) => {
  const apiKey = Lockr.get('JinyaApiKey');
  if (!apiKey && to.name !== Routes.Account.Login.name) {
    next(Routes.Account.Login.route);
  } else {
    EventBus.$emit(Events.navigation.navigated);
    next();
  }
});

export default router;<commit_msg>Added document title change on navigate<commit_after>import Vue from 'vue';
import Router from 'vue-router';
import Lockr from 'lockr';
import Routes from "./Routes";
import EventBus from "../components/Framework/Events/EventBus";

import Account from './account';
import Art from './art';
import Static from './static';
import Home from './home';
import Configuration from './configuration';
import Maintenance from './maintenance';
import MyJinya from './myjinya';
import Events from "../components/Framework/Events/Events";
import Translator from "@/components/Framework/i18n/Translator";

const routes = Home
  .concat(Account)
  .concat(Art)
  .concat(Static)
  .concat(Configuration)
  .concat(Maintenance)
  .concat(MyJinya);

Vue.use(Router);

const router = new Router({
  mode: 'history',
  routes: routes
});

router.beforeEach((to, from, next) => {
  const apiKey = Lockr.get('JinyaApiKey');
  if (!apiKey && to.name !== Routes.Account.Login.name) {
    next(Routes.Account.Login.route);
  } else {
    EventBus.$emit(Events.navigation.navigated);
    document.title = to.meta && to.meta.title ? Translator.message(to.meta.title) : '';
    next();
  }
});

export default router;
{'fraction_non_alphanumeric': 0.15478892419428053, 'fraction_numerical': 0.0009078529278256923, 'mean_word_length': 4.349514563106796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2403579', 'n_tokens_mistral': 687, 'n_tokens_neox': 678, 'n_words': 186}