Make the new src/translations.js more concise

This commit is contained in:
nthnchu 2020-10-02 11:59:00 +00:00
parent dc067e6f2b
commit 4175484d69
5 changed files with 22 additions and 22 deletions

View File

@ -140,9 +140,9 @@ const renderRepoCard = (repo, options = {}) => {
return card.render(`
${
isTemplate
? getBadgeSVG(i18n.t("repocard.template"))
? getBadgeSVG(i18n.t("template"))
: isArchived
? getBadgeSVG(i18n.t("repocard.archived"))
? getBadgeSVG(i18n.t("archived"))
: ""
}

View File

@ -87,13 +87,13 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
const STATS = {
stars: {
icon: icons.star,
label: i18n.t("statcard.totalstars"),
label: i18n.t("totalstars"),
value: totalStars,
id: "stars",
},
commits: {
icon: icons.commits,
label: `${i18n.t("statcard.commits")}${
label: `${i18n.t("commits")}${
include_all_commits ? "" : ` (${new Date().getFullYear()})`
}`,
value: totalCommits,
@ -101,19 +101,19 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
},
prs: {
icon: icons.prs,
label: i18n.t("statcard.prs"),
label: i18n.t("prs"),
value: totalPRs,
id: "prs",
},
issues: {
icon: icons.issues,
label: i18n.t("statcard.issues"),
label: i18n.t("issues"),
value: totalIssues,
id: "issues",
},
contribs: {
icon: icons.contribs,
label: i18n.t("statcard.contribs"),
label: i18n.t("contribs"),
value: contributedTo,
id: "contribs",
},
@ -172,7 +172,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
const card = new Card({
customTitle: custom_title,
defaultTitle: i18n.t("statcard.title"),
defaultTitle: i18n.t("title"),
width: 495,
height,
colors: {

View File

@ -180,7 +180,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
const card = new Card({
customTitle: custom_title,
defaultTitle: i18n.t("langcard.title"),
defaultTitle: i18n.t("title"),
width,
height,
colors: {

View File

@ -109,7 +109,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
const card = new Card({
customTitle: custom_title,
defaultTitle: i18n.t("wakatimecard.title"),
defaultTitle: i18n.t("title"),
width: 495,
height,
colors: {
@ -137,7 +137,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
: [
noCodingActivityNode({
color: textColor,
text: i18n.t("wakatimecard.nocodingactivity"),
text: i18n.t("nocodingactivity"),
}),
],
gap: lheight,

View File

@ -2,7 +2,7 @@ const { encodeHTML } = require("./common/utils");
const statCardLocales = ({ name, apostrophe }) => {
return {
"statcard.title": {
"title": {
cn: `${encodeHTML(name)}的GitHub统计`,
de: `${encodeHTML(name) + apostrophe} GitHub-Statistiken`,
en: `${encodeHTML(name)}'${apostrophe} GitHub Stats`,
@ -13,7 +13,7 @@ const statCardLocales = ({ name, apostrophe }) => {
kr: `${encodeHTML(name)}의 GitHub 통계`,
"pt-br": `Estatísticas do GitHub de ${encodeHTML(name)}`,
},
"statcard.totalstars": {
"totalstars": {
cn: "总星数",
de: "Sterne Insgesamt",
en: "Total Stars",
@ -24,7 +24,7 @@ const statCardLocales = ({ name, apostrophe }) => {
kr: "총 별",
"pt-br": "Total de estrelas",
},
"statcard.commits": {
"commits": {
cn: "总承诺",
de: "Anzahl Commits",
en: "Total Commits",
@ -35,7 +35,7 @@ const statCardLocales = ({ name, apostrophe }) => {
kr: "총 커밋",
"pt-br": "Total de compromissos",
},
"statcard.prs": {
"prs": {
cn: "总公关",
de: "PRs Insgesamt",
en: "Total PRs",
@ -46,7 +46,7 @@ const statCardLocales = ({ name, apostrophe }) => {
kr: "총 PR",
"pt-br": "Total de PRs",
},
"statcard.issues": {
"issues": {
cn: "总发行量",
de: "Anzahl Issues",
en: "Total Issues",
@ -57,7 +57,7 @@ const statCardLocales = ({ name, apostrophe }) => {
kr: "총 문제",
"pt-br": "Total de problemas",
},
"statcard.contribs": {
"contribs": {
cn: "有助于",
de: "Beigetragen zu",
en: "Contributed to",
@ -72,7 +72,7 @@ const statCardLocales = ({ name, apostrophe }) => {
};
const repoCardLocales = {
"repocard.template": {
"template": {
cn: "模板",
de: "Vorlage",
en: "Template",
@ -83,7 +83,7 @@ const repoCardLocales = {
kr: "주형",
"pt-br": "Modelo",
},
"repocard.archived": {
"archived": {
cn: "已封存",
de: "Archiviert",
en: "Archived",
@ -97,7 +97,7 @@ const repoCardLocales = {
};
const langCardLocales = {
"langcard.title": {
"title": {
cn: "最常用的语言",
de: "Meist verwendete Sprachen",
en: "Most Used Languages",
@ -111,7 +111,7 @@ const langCardLocales = {
};
const wakatimeCardLocales = {
"wakatimecard.title": {
"title": {
cn: "Wakatime周统计",
de: "Wakatime Wochen Status",
en: "Wakatime Week Stats",
@ -122,7 +122,7 @@ const wakatimeCardLocales = {
kr: "Wakatime 주간 통계",
"pt-br": "Estatísticas da semana Wakatime",
},
"wakatimecard.nocodingactivity": {
"nocodingactivity": {
cn: "本周没有编码活动",
de: "Keine Codierungsaktivität diese Woche",
en: "No coding activity this week",