Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinrich-XIAO committed Sep 24, 2024
1 parent 50ea1a7 commit bdbb6a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/config/setupTranslations.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ function loadTranslationsFolder(folder) {
changelog,
),
),
news: newsFiles.map(filePath => marked.parse(fs.existsSync(path.join(folder, 'news', languageCode, filePath)) ? fs.readFileSync(path.join(folder, 'news', languageCode, filePath)).toString() : fs.readFileSync(path.join(folder, 'news', getDefaultLanguage(), filePath)).toString())).join('\n<br>\n') // I will refactor this later
news: newsFiles.map(filePath => {
const fullPath = path.join(folder, 'news', languageCode, filePath);
return marked.parse(fs.existsSync(fullPath) ? fs.readFileSync(fullPath).toString() : fs.readFileSync(path.join(folder, 'news', getDefaultLanguage(), filePath)).toString());
}).join('\n<br>\n')
};
console.log(resources[languageCode].news)
supportedLanguages.push(languageCode); // Add language to list of supportedLanguages
Expand Down

0 comments on commit bdbb6a8

Please sign in to comment.