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:
parent
ac11b53619
commit
679cc423f5
3 changed files with 14 additions and 6 deletions
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue