Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/cards/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ const renderStatsCard = (stats, options = {}) => {
totalDiscussionsStarted,
totalDiscussionsAnswered,
contributedTo,
followers,
totalRepos,
rank,
} = stats;
const {
Expand Down Expand Up @@ -409,6 +411,24 @@ const renderStatsCard = (stats, options = {}) => {
id: "contribs",
};

if (show.includes("followers")) {
STATS.followers = {
icon: icons.followers,
label: i18n.t("statcard.followers"),
value: followers,
id: "followers",
};
}

if (show.includes("repos")) {
STATS.repos = {
icon: icons.repos,
label: i18n.t("statcard.repos"),
value: totalRepos,
id: "repos",
};
}

// @ts-ignore
const isLongLocale = locale ? LONG_LOCALES.includes(locale) : false;

Expand Down
2 changes: 2 additions & 0 deletions src/common/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/fetchers/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const GRAPHQL_STATS_QUERY = `
followers {
totalCount
}
repositories {
totalCount
}
repositoryDiscussions @include(if: $includeDiscussions) {
totalCount
}
Expand Down Expand Up @@ -249,6 +252,8 @@ const fetchStats = async (
totalDiscussionsStarted: 0,
totalDiscussionsAnswered: 0,
contributedTo: 0,
followers: 0,
totalRepos: 0,
rank: { level: "C", percentile: 100 },
};

Expand Down Expand Up @@ -301,6 +306,8 @@ const fetchStats = async (
}
stats.totalReviews = user.reviews.totalPullRequestReviewContributions;
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;
stats.followers = user.followers.totalCount;
stats.totalRepos = user.repositories.totalCount;
if (include_discussions) {
stats.totalDiscussionsStarted = user.repositoryDiscussions.totalCount;
}
Expand Down
96 changes: 96 additions & 0 deletions src/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,102 @@ const statCardLocales = ({ name, apostrophe }) => {
"sr-latn": "Procenat spojenih PR-ova",
no: "Prosentandel sammenslåtte PR",
},
"statcard.followers": {
en: "Followers",
ar: "المتابعون",
az: "İzləyicilər",
ca: "Seguidors",
cn: "关注者",
"zh-tw": "關注者",
cs: "Sledující",
de: "Follower",
sw: "Wafuataji",
ur: " پیروکار",
bg: "Последователи",
bn: "অনুসারী",
es: "Seguidores",
fa: "دنبال کننده‌ها",
fi: "Seuraajat",
fr: "Abonnés",
hi: "अनुयायी",
sa: "अనుయాయులు",
hu: "Követők",
it: "Follower",
ja: "フォロワー",
kr: "팔로워",
nl: "Volgers",
"pt-pt": "Seguidores",
"pt-br": "Seguidores",
np: "अनुయాయीहरू",
el: "Ακολουθητές",
ro: "Urmăritori",
ru: "Подписчики",
"uk-ua": "Підписники",
id: "Pengikut",
ml: "ഫോളോവേർകൾ",
my: "နောက်လိုက်သူများ",
ta: "பின்பற்றுபவர்கள்",
sk: "Nasledovníci",
tr: "Takipçiler",
pl: "Obserwujący",
uz: "Kuzatuvchilar",
vi: "Người Theo Dõi",
se: "Följare",
he: "עוקבים",
fil: "Mga Tagasunod",
th: "ผู้ติดตาม",
sr: "Пратиоци",
"sr-latn": "Pratoci",
no: "Følgere",
},
"statcard.repos": {
en: "Total Repositories",
ar: "مجموع المستودعات",
az: "Ümumi Repozitorilər",
ca: "Total de repositoris",
cn: "仓库总数",
"zh-tw": "儲存庫總數",
cs: "Celkem repozitářů",
de: "Gesamtzahl Repositories",
sw: "Idadi ya Vifaa vya Hifadhi",
ur: "کل ذخیرے",
bg: "Общо хранилища",
bn: "মোট রিপোজিটরি",
es: "Total de repositorios",
fa: "مجموع مخزن‌ها",
fi: "Yhteensä repositorioita",
fr: "Total des dépôts",
hi: "कुल भंडार",
sa: "కుల-సంగ్రహాలు",
hu: "Összes tároló",
it: "Repository totali",
ja: "リポジトリ総数",
kr: "리포지토리 총 수",
nl: "Totaal aantal repositories",
"pt-pt": "Total de repositórios",
"pt-br": "Total de repositórios",
np: "కుల భండారాలు",
el: "Σύνολο αποθετηρίων",
ro: "Total Depozite",
ru: "Всего репозиториев",
"uk-ua": "Всього репозиторіїв",
id: "Total Repositori",
ml: "ആകെ റിപ്പോസിറ്ററികൾ",
my: "စုစုပေါင်း ရှိတိုင်းများ",
ta: "மொத்த களஞ்சியங்கள்",
sk: "Celkom repozitárov",
tr: "Toplam Depo",
pl: "Wszystkie repozytoria",
uz: "Jami repozitoriyalar",
vi: "Tổng Số Kho",
se: "Totalt antal repos",
he: "סך כל המאגרים",
fil: "Kabuuang mga Repositorio",
th: "ทุก Repository",
sr: "Укупно репозиторијума",
"sr-latn": "Ukupno repozitorijuma",
no: "Totalt antall repoer",
},
};
};

Expand Down