support for emoji formatting
This commit is contained in:
parent
60012a12c1
commit
0491dee1f8
@ -3,6 +3,7 @@ const fs = require('fs');
|
|||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
|
|
||||||
const Util = require('../../Util.js');
|
const Util = require('../../Util.js');
|
||||||
|
const { Emojis } = require('../../constants/index.js');
|
||||||
|
|
||||||
class LocaleLoader {
|
class LocaleLoader {
|
||||||
|
|
||||||
@ -27,7 +28,9 @@ class LocaleLoader {
|
|||||||
|
|
||||||
if (!this.languages[language]) return `< Missing Locale: ${language} >`;
|
if (!this.languages[language]) return `< Missing Locale: ${language} >`;
|
||||||
let string = this.languages[language][index];
|
let string = this.languages[language][index];
|
||||||
if(!string) return `< Missing Locale Index: ${language}.${index} >`;
|
if (!string) return `< Missing Locale Index: ${language}.${index} >`;
|
||||||
|
|
||||||
|
for (const emoji of Object.keys(Emojis)) parameters[`emoji_${emoji}`] = Emojis[emoji];
|
||||||
|
|
||||||
for(const [ parameter, value ] of Object.entries(parameters)) {
|
for(const [ parameter, value ] of Object.entries(parameters)) {
|
||||||
string = string.replace(new RegExp(Util.escapeRegex(`{${parameter.toLowerCase()}}`), 'giu'), value);
|
string = string.replace(new RegExp(Util.escapeRegex(`{${parameter.toLowerCase()}}`), 'giu'), value);
|
||||||
|
Loading…
Reference in New Issue
Block a user