forked from mirrored/github-readme-stats
Add Card Translations
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user