Add Card Translations

This commit is contained in:
Nathan Chu
2020-09-28 12:19:12 -04:00
parent 057ff69ac2
commit b529b25320
8 changed files with 174 additions and 14 deletions
+6
View File
@@ -21,6 +21,7 @@ module.exports = async (req, res) => {
theme,
show_owner,
cache_seconds,
lang,
} = req.query;
let repoData;
@@ -31,6 +32,10 @@ module.exports = async (req, res) => {
return res.send(renderError("Something went wrong"));
}
if (lang && ![ "cn", "de", "en", "es", "fr", "it", "ja", "kr", "pt-br" ].includes(lang.toLowerCase())) {
return res.send(renderError("Something went wrong", "Language not found"));
}
try {
repoData = await fetchRepo(username, repo);
@@ -64,6 +69,7 @@ module.exports = async (req, res) => {
bg_color,
theme,
show_owner: parseBoolean(show_owner),
lang: lang ? lang.toLowerCase() : null,
}),
);
} catch (err) {