This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2020-09-28 08:51:26 -07:00
|
|
|
import Vue from 'vue'
|
|
|
|
import t from '../src/translator';
|
2020-09-28 09:29:13 -07:00
|
|
|
import config from '../data/config.suml';
|
2020-09-29 10:11:46 -07:00
|
|
|
import { locales } from '../src/data';
|
2020-10-17 09:19:11 -07:00
|
|
|
import {buildDict} from "../src/helpers";
|
2020-09-28 08:51:26 -07:00
|
|
|
|
|
|
|
export default ({ app }) => {
|
|
|
|
Vue.prototype.$t = t;
|
2020-09-28 09:29:13 -07:00
|
|
|
Vue.prototype.config = config;
|
2020-10-17 09:19:11 -07:00
|
|
|
Vue.prototype.locales = buildDict(function* () {
|
|
|
|
yield [ config.locale, locales[config.locale] ];
|
|
|
|
for (let l in locales) {
|
|
|
|
if (locales.hasOwnProperty(l) && l !== config.locale) {
|
|
|
|
yield [l, locales[l]];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2020-09-28 08:51:26 -07:00
|
|
|
}
|