This commit is contained in:
@@ -301,7 +301,7 @@ export default {
|
||||
//translation keys that start with LT:
|
||||
//translate each and replace and return the string translated
|
||||
// (fetch and cache any missing strings)
|
||||
async translateStringWithMultipleKeys(s) {
|
||||
async translateStringWithMultipleKeysAsync(s) {
|
||||
let ret = s;
|
||||
let found = s.match(/LT:[\w]*/gm);
|
||||
if (found == null) {
|
||||
@@ -324,6 +324,26 @@ export default {
|
||||
|
||||
return ret;
|
||||
},
|
||||
////////////////////////////////////////////////////////
|
||||
// Take in a string that contains one or more
|
||||
//translation keys that start with LT:
|
||||
//translate each and replace and return the string translated
|
||||
// (DOES NOT fetch and cache any missing strings, they must exist)
|
||||
//this is the sync version to be used in non async capable code
|
||||
translateStringWithMultipleKeys(s) {
|
||||
let ret = s;
|
||||
let found = s.match(/LT:[\w]*/gm);
|
||||
if (found == null) {
|
||||
return ret;
|
||||
}
|
||||
//replace
|
||||
found.forEach(z => {
|
||||
let translated = this.get(z.replace("LT:", ""));
|
||||
//replace all
|
||||
ret = ret.split(z).join(translated);
|
||||
});
|
||||
return ret;
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// dynamically set the vuetify language elements from
|
||||
|
||||
Reference in New Issue
Block a user