diff --git a/locales/english.json b/locales/english.json index 3e6af90..ccf4802 100644 --- a/locales/english.json +++ b/locales/english.json @@ -1,7 +1,7 @@ { "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!*", - "lynxPrivacy": "*Check out the link below to read the bot privacy policy:*\n• https://blog.eleu.me/posts/lynx-privacy-policy", + "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 [this link](https://blog.eleu.me/posts/lynx-privacy-policy) to read the bot privacy policy.", "unKnown": "Unknown", "varYes": "Yes", "varNo": "No", diff --git a/locales/portuguese.json b/locales/portuguese.json index 995c1ec..c7b8a1f 100644 --- a/locales/portuguese.json +++ b/locales/portuguese.json @@ -1,7 +1,7 @@ { "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!*", - "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", + "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 [nesse link](https://blog.eleu.me/posts/lynx-privacy-policy) para ler a política de privacidade do bot.", "unKnown": "Desconhecido", "varYes": "Sim", "varNo": "Não", diff --git a/plugins/checklang.js b/plugins/checklang.js index 3231167..352bf91 100644 --- a/plugins/checklang.js +++ b/plugins/checklang.js @@ -1,8 +1,16 @@ +const languageFiles = { + 'pt': '../locales/portuguese.json', + 'pt-br': '../locales/portuguese.json', + 'en': '../locales/english.json' +}; + function getStrings(languageCode) { - if (languageCode === 'pt' || 'pt-br') { - return require('../locales/portuguese.json'); - } else { - return require('../locales/english.json'); + const filePath = languageFiles[languageCode] || languageFiles['en']; + try { + return require(filePath); + } catch (error) { + console.error(`Error loading language file for code ${languageCode}:`, error); + return require(languageFiles['en']); } }