fix profile names
This commit is contained in:
@@ -65,30 +65,34 @@ export class I18nService {
|
||||
}
|
||||
|
||||
get(key, args: string[]): string {
|
||||
return this.getInternal(key, args, this.i18n, "");
|
||||
return this.getInternal(key, args, this.i18n, "", true);
|
||||
}
|
||||
|
||||
getInternal(key, args: string[], from, path): string {
|
||||
getEmpty(key, args: string[]): string {
|
||||
return this.getInternal(key, args, this.i18n, "", false);
|
||||
}
|
||||
|
||||
getInternal(key, args: string[], from, path, empty : boolean): string {
|
||||
key += '';
|
||||
if (!from) {
|
||||
return this.empty(key, args, path);
|
||||
return empty ? this.empty(key, args, path) : key;
|
||||
} else if (from[ key ]) {
|
||||
if (typeof from[ key ] === 'object') {
|
||||
if (from[ key ][ "." ]) {
|
||||
return this.insertArguments(from[ key ][ "." ], args);
|
||||
}
|
||||
return this.empty(key, args, path);
|
||||
return empty ? this.empty(key, args, path) : key;
|
||||
}
|
||||
return this.insertArguments(from[ key ], args);
|
||||
} else {
|
||||
let keys = key.split(".");
|
||||
if (from[ keys[ 0 ] ]) {
|
||||
key = keys.slice(1, keys.length).join(".");
|
||||
return this.getInternal(key, args, from[ keys[ 0 ] ], path + keys[ 0 ] + ".")
|
||||
return this.getInternal(key, args, from[ keys[ 0 ] ], path + keys[ 0 ] + ".", empty)
|
||||
}
|
||||
}
|
||||
|
||||
return this.empty(key, args, path);
|
||||
return empty ? this.empty(key, args, path) : key;
|
||||
}
|
||||
|
||||
empty(key, args: string[], path: string): string {
|
||||
|
||||
Reference in New Issue
Block a user