Fix english
This commit is contained in:
parent
ac11b53619
commit
91a363d15e
2 changed files with 13 additions and 5 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