Fix english
This commit is contained in:
parent
ac11b53619
commit
91a363d15e
2 changed files with 13 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"lynxWelcome": "*Hello! I am Lynx!*\nI was made with love by Lucas Gabriel (lucmsilva)!\n\n*Before using, you will need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to show the bot commands!",
|
"lynxWelcome": "*Hello! I am Lynx!*\nI was made with love by Lucas Gabriel (lucmsilva)!\n\n*Before using, you will need to read the privacy policy (/privacy) to understand where your data goes when using this bot.*\n\nAlso, you can use /help to show the bot commands!",
|
||||||
"lynxHelp": "*Hello! I'm Lynx!*\n\nI'm a simple bot made entirely from scratch in Telegraf and Node.js by Lucas Gabriel (lucmsilva).\n*Cat pictures (profile photo/help): [@monkeycatluna](https://www.instagram.com/monkeycatluna/)\n\n*Some commands to test:*\n• */chatinfo* - send some information about the group\n• */customize* - customize your pronouns (WIP)\n• */dice* - send an emoji of a dice (random results)\n• */furry* - check if you are a furry\n• */gay* - check if you are gay\n• */help* - send this message\n• */privacy* - read the Privacy Policy\n• */random* - pick a random number between 0-10\n• */start* - start the bot\n• */slot* - send an interactive emoji of a casino slot\n• */userinfo* - send some information about yourself\n\n*See my source code in my* [GitHub repository](https://github.com/lucmsilva651/lynx)*.*\n\nThanks to all users, testers, contributors, and others. Without you, perhaps this bot wouldn't be possible ❤️\n\n*Special thanks to @givfnz for his many contributions to the bot!*",
|
"lynxHelp": "*Hello! I'm Lynx!*\n\nI'm a simple bot made entirely from scratch in Telegraf and Node.js by Lucas Gabriel (lucmsilva).\n\n*Cat pictures (profile photo/help):* [@monkeycatluna](https://www.instagram.com/monkeycatluna/)\n\n*Some commands to test:*\n• */chatinfo* - send some information about the group\n• */customize* - customize your pronouns (WIP)\n• */dice* - send an emoji of a dice (random results)\n• */furry* - check if you are a furry\n• */gay* - check if you are gay\n• */help* - send this message\n• */privacy* - read the Privacy Policy\n• */random* - pick a random number between 0-10\n• */start* - start the bot\n• */slot* - send an interactive emoji of a casino slot\n• */userinfo* - send some information about yourself\n\n*See my source code in my* [GitHub repository](https://github.com/lucmsilva651/lynx)*.*\n\nThanks to all users, testers, contributors, and others. Without you, perhaps this bot wouldn't be possible ❤️\n\n*Special thanks to @givfnz2 for his many contributions to the bot!*",
|
||||||
"lynxPrivacy": "*Check out the link below to read the bot privacy policy:*\n• https://blog.eleu.me/posts/lynx-privacy-policy",
|
"lynxPrivacy": "*Check out the link below to read the bot privacy policy:*\n• https://blog.eleu.me/posts/lynx-privacy-policy",
|
||||||
"unKnown": "Unknown",
|
"unKnown": "Unknown",
|
||||||
"varYes": "Yes",
|
"varYes": "Yes",
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
|
const languageFiles = {
|
||||||
|
'pt': '../locales/portuguese.json',
|
||||||
|
'pt-br': '../locales/portuguese.json',
|
||||||
|
'en': '../locales/english.json'
|
||||||
|
};
|
||||||
|
|
||||||
function getStrings(languageCode) {
|
function getStrings(languageCode) {
|
||||||
if (languageCode === 'pt' || 'pt-br') {
|
const filePath = languageFiles[languageCode] || languageFiles['en'];
|
||||||
return require('../locales/portuguese.json');
|
try {
|
||||||
} else {
|
return require(filePath);
|
||||||
return require('../locales/english.json');
|
} catch (error) {
|
||||||
|
console.error(`Error loading language file for code ${languageCode}:`, error);
|
||||||
|
return require(languageFiles['en']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue