Update stats-card.js

This commit is contained in:
Zohan Subhash
2023-01-14 11:57:53 +05:30
committed by GitHub
parent 70b0d025f8
commit 8f63eaeef9
+12 -9
View File
@@ -97,8 +97,19 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
locale,
disable_animations = false,
} = options;
const name = stats.name || "GitHub User",
const apostrophe = ["x", "s"].includes(name.slice(-1).toLocaleLowerCase())
? ""
: "s";
const i18n = new I18n({
locale,
translations: statCardLocales({ name, apostrophe }),
});
const {
name = "GitHub User",
totalStars = "2018",
totalCommits = "29019",
totalIssues = "203",
@@ -132,14 +143,6 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
theme,
});
const apostrophe = ["x", "s"].includes(name.slice(-1).toLocaleLowerCase())
? ""
: "s";
const i18n = new I18n({
locale,
translations: statCardLocales({ name, apostrophe }),
});
// Meta data for creating text nodes with createTextNode function
const STATS = {
stars: {