Get the language module out of spot.js
This commit is contained in:
+2
-2
@@ -5,7 +5,7 @@ export default class Lang {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
lang(key = '', params = []) {
|
||||
get(key = '', params = []) {
|
||||
if(key === '') return '';
|
||||
|
||||
const normalizedParams = Array.isArray(params) ? params : [params];
|
||||
@@ -24,7 +24,7 @@ export default class Lang {
|
||||
|
||||
parse(message = '') {
|
||||
if(this.prefix && typeof message === 'string' && message.startsWith(this.prefix)) {
|
||||
return this.lang(message.slice(this.prefix.length));
|
||||
return this.get(message.slice(this.prefix.length));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user