move basic stuff into ZeroVue config which is loaded by vue on startup

This commit is contained in:
2020-04-11 17:45:39 +02:00
parent 2838eeadab
commit 2799f62be8
7 changed files with 203 additions and 79 deletions
+2 -14
View File
@@ -2,8 +2,6 @@ import { extend as _extend, each as _each } from 'underscore';
export default {
cache: zero.translations,
localize(key, options)
{
let params = _extend({
@@ -24,19 +22,9 @@ export default {
}
key = hasAtSign ? key.slice(1) : key;
let value = this.cache;
const value = zero.translations[key];
for (let part of key.split('.'))
{
if (!value[part])
{
break;
}
value = value[part];
}
if (!value || value === this.cache || typeof value !== 'string')
if (!value || typeof value !== 'string')
{
return '[' + key + ']';
}