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(` return card.render(`
${ ${
isTemplate isTemplate
? getBadgeSVG(i18n.t("repocard.template")) ? getBadgeSVG(i18n.t("template"))
: isArchived : isArchived
? getBadgeSVG(i18n.t("repocard.archived")) ? getBadgeSVG(i18n.t("archived"))
: "" : ""
} }

View File

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

View File

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

View File

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

View File

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