Get the language module out of spot.js

This commit is contained in:
2026-04-25 19:36:03 +02:00
parent ff4bc26381
commit 7dc2b28c44
11 changed files with 89 additions and 106 deletions
+2 -2
View File
@@ -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;
}