This commit is contained in:
2020-04-02 14:18:28 +00:00
parent fbe647a799
commit a81ee7d204
4 changed files with 48 additions and 46 deletions

View File

@@ -14,8 +14,8 @@ export default {
//step 1: build an array of keys that we don't have already
//Note: this will ensure only unique keys go into the store so it's safe to call this with dupes as can happen
//for example datatables have dynamic column names so they need to fetch on demand
var needIt = [];
for (var i = 0; i < keys.length; i++) {
let needIt = [];
for (let i = 0; i < keys.length; i++) {
if (
!window.$gz._.has(window.$gz.store.state.translationText, keys[i])
) {
@@ -167,13 +167,13 @@ export default {
//translate each and return the string translated
//
translateString(s) {
var ret = s;
var pattern = /\[(.*?)\]/g;
var match;
let ret = s;
let pattern = /\[(.*?)\]/g;
let match;
while ((match = pattern.exec(s)) != null) {
var foundMatch = match[0];
var tKey = match[1];
var newValue = this.get(tKey);
let foundMatch = match[0];
let tKey = match[1];
let newValue = this.get(tKey);
ret = ret.replace(foundMatch, newValue);
}
return ret;