Fix english (#7)

* Fix english

* Add cat picture credit to the help command in portuguese.json

---------

Co-authored-by: GiovaniFZ <giovanifinazzi@gmail.com>
This commit is contained in:
mthlma 2024-07-29 20:08:29 -03:00 committed by GitHub
parent ac11b53619
commit 679cc423f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 6 deletions

View File

@ -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",

View File

@ -1,6 +1,6 @@
{ {
"lynxWelcome": "*Olá! Eu sou o Lynx!*\nEu fui feito com amor por Lucas Gabriel (lucmsilva)!\n\n*Antes de usar, você precisará ler a política de privacidade (/privacy) para entender para onde seus dados vão ao usar este bot.\n\n*Além disso, você pode usar o /help para mostrar os comandos do bot.", "lynxWelcome": "*Olá! Eu sou o Lynx!*\nEu fui feito com amor por Lucas Gabriel (lucmsilva)!\n\n*Antes de usar, você precisará ler a política de privacidade (/privacy) para entender para onde seus dados vão ao usar este bot.\n\n*Além disso, você pode usar o /help para mostrar os comandos do bot.",
"lynxHelp": "*Olá! Eu sou o Lynx!*\n\nSou um simples bot feito inteiramente do zero em Telegraf e Node.js por Lucas Gabriel (lucmsilva).\n\n*Alguns comandos para testar:*\n• */chatinfo* - envia algumas informações sobre o grupo\n• */customize* - customiza seus pronomes (WIP)\n• */furry* - checa se você é um furry\n• */gay* - checa se você é gay\n• */help* - envia essa mensagem\n• */privacy* - envia a política de privacidade\n• */random* - escolhe um número aleatório entre 0-10\n• */start* - Inicia o bot\n• */userinfo* - envia algumas informações sobre você\n\n*Veja o código fonte em meu* [repositório no GitHub](https://github.com/lucmsilva651/lynx)*.*\n\nObrigado a todos os usuários, testadores, contribuidores e outros. Sem vocês, talvez esse bot não seria possível ❤️\n\n*Um agradecimento especial a @givfnz pelas várias contribuições ao bot!*", "lynxHelp": "*Olá! Eu sou o Lynx!*\n\nSou um simples bot feito inteiramente do zero em Telegraf e Node.js por Lucas Gabriel (lucmsilva).\n\n*Fotos do gato (foto de perfil/ajuda):* [@monkeycatluna](https://www.instagram.com/monkeycatluna/)\n\n*Alguns comandos para testar:*\n• */chatinfo* - envia algumas informações sobre o grupo\n• */customize* - customiza seus pronomes (WIP)\n• */furry* - checa se você é um furry\n• */gay* - checa se você é gay\n• */help* - envia essa mensagem\n• */privacy* - envia a política de privacidade\n• */random* - escolhe um número aleatório entre 0-10\n• */start* - Inicia o bot\n• */userinfo* - envia algumas informações sobre você\n\n*Veja o código fonte em meu* [repositório no GitHub](https://github.com/lucmsilva651/lynx)*.*\n\nObrigado a todos os usuários, testadores, contribuidores e outros. Sem vocês, talvez esse bot não seria possível ❤️\n\n*Um agradecimento especial a @givfnz2 pelas várias contribuições ao bot!*",
"lynxPrivacy": "*Dê uma olhada no link abaixo para ler a política de privacidade do bot:*\n• https://blog.eleu.me/posts/lynx-privacy-policy", "lynxPrivacy": "*Dê uma olhada no link abaixo para ler a política de privacidade do bot:*\n• https://blog.eleu.me/posts/lynx-privacy-policy",
"unKnown": "Desconhecido", "unKnown": "Desconhecido",
"varYes": "Sim", "varYes": "Sim",

View File

@ -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']);
} }
} }