Huge refactoring (WIP)

This commit is contained in:
Pieter Vander Vennet 2020-10-27 01:01:34 +01:00
parent 62c4f0a928
commit 895aa132ec
55 changed files with 1177 additions and 2190 deletions

View file

@ -1056,6 +1056,22 @@ export default class Translations {
return s;
}
static T(t: string | any): Translation {
if(t === undefined){
return undefined;
}
if(typeof t === "string"){
return new Translation({"*":t});
}
if(t.render !== undefined){
const msg = "Creating a translation, but this object contains a 'render'-field. Use the translation directly"
console.error(msg, t);
throw msg
}
return new Translation(t);
}
private static wtcache = {}
public static WT(s: string | Translation): Translation {
if(s === undefined){