This commit is contained in:
@@ -70,6 +70,9 @@ export default {
|
||||
}
|
||||
},
|
||||
get(key) {
|
||||
if (!key) {
|
||||
return "??NO_TRANSLATION_KEY";
|
||||
}
|
||||
//no translation for Wiki
|
||||
if (key == "Wiki") {
|
||||
return "Wiki";
|
||||
@@ -205,6 +208,7 @@ export default {
|
||||
"SelectedItems",
|
||||
"AllItemsInList",
|
||||
"NoData",
|
||||
"Errors",
|
||||
"ErrorFieldLengthExceeded",
|
||||
"ErrorStartDateAfterEndDate",
|
||||
"ErrorRequiredFieldEmpty",
|
||||
@@ -288,23 +292,19 @@ export default {
|
||||
//translate each and replace and return the string translated
|
||||
//
|
||||
translateString(s) {
|
||||
// let ret = s;
|
||||
// let pattern = /\[(.*?)\]/g;
|
||||
// let match;
|
||||
// while ((match = pattern.exec(s)) != null) {
|
||||
// let foundMatch = match[0];
|
||||
// let tKey = match[1];
|
||||
// let newValue = this.get(tKey);
|
||||
// ret = ret.replace(foundMatch, newValue);
|
||||
// }
|
||||
// return ret;
|
||||
|
||||
console.log("#### START OF translateString:", s);
|
||||
let ret = s;
|
||||
let pattern = /\bLT:[a-zA-Z]*\b/g;
|
||||
let match;
|
||||
|
||||
This is fucked, maybe change it, not sure what the fuck it's doing actually it doesn't seem to be iterating each key
|
||||
//seems to be missing shit, not right, missses if start of string, matches just LT: by itself for some reason...meh
|
||||
|
||||
while ((match = pattern.exec(s)) != null) {
|
||||
console.log("Match: ", match);
|
||||
let foundMatch = match[0];
|
||||
let tKey = match[1];
|
||||
console.log("Geting value for key:", tKey);
|
||||
let newValue = this.get(tKey);
|
||||
ret = ret.replace(foundMatch, newValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user