mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00

* Fix english * Add cat picture credit to the help command in portuguese.json --------- Co-authored-by: GiovaniFZ <giovanifinazzi@gmail.com>
19 lines
471 B
JavaScript
19 lines
471 B
JavaScript
const languageFiles = {
|
|
'pt': '../locales/portuguese.json',
|
|
'pt-br': '../locales/portuguese.json',
|
|
'en': '../locales/english.json'
|
|
};
|
|
|
|
function getStrings(languageCode) {
|
|
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']);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
getStrings
|
|
}; |