This commit is contained in:
@@ -284,12 +284,23 @@ export default {
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// Take in a string that contains one or more
|
||||
//translation keys between square brackets
|
||||
//translate each and return the string translated
|
||||
//translation keys that start with LT:
|
||||
//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;
|
||||
|
||||
let ret = s;
|
||||
let pattern = /\[(.*?)\]/g;
|
||||
let pattern = /\bLT:[a-zA-Z]*\b/g;
|
||||
let match;
|
||||
while ((match = pattern.exec(s)) != null) {
|
||||
let foundMatch = match[0];
|
||||
@@ -298,6 +309,9 @@ export default {
|
||||
ret = ret.replace(foundMatch, newValue);
|
||||
}
|
||||
return ret;
|
||||
// const regex = /\bLT:[a-zA-Z]*\b/g;
|
||||
// const found = stringtosearch.match(regex);
|
||||
// found=array of strings
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user