Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix repoContrib confusion (#2269) #2274

Merged
merged 1 commit into from
Nov 22, 2022
Merged
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
4 changes: 2 additions & 2 deletions src/cards/stats-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
},
contribs: {
icon: icons.contribs,
label: i18n.t("statcard.contribs"),
label: i18n.t("statcard.contribs") + " (last year)",
value: contributedTo,
id: "contribs",
},
Expand Down Expand Up @@ -186,7 +186,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
index,
showIcons: show_icons,
shiftValuePos:
(!include_all_commits ? 50 : 35) + (isLongLocale ? 50 : 0),
(!include_all_commits ? 79.01 : 35) + (isLongLocale ? 50 : 0),
bold: text_bold,
}),
);
Expand Down
2 changes: 1 addition & 1 deletion tests/renderStatsCard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ describe("Test renderStatsCard", () => {
document.querySelector(
'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
).textContent,
).toMatchInlineSnapshot(`"参与项目数:"`);
).toMatchInlineSnapshot(`"参与项目数 (last year):"`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parenthesized (star), (commit), (PR), and (issue) above are annotating the Chinese terms , 提交, 拉取请求, and 问题.
(last year) breaks parallelism both syntactically (half-width vs full-width parentheses) and semantically (should be "过去一年" rather than "last year").

I understand it's an i18n problem. Maybe worth tracking it somewhere? @anuraghazra

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyishuai, you are 100% correct. When I added that code, I didn't have time to implement the i18n translations; feel free to create an issue and implement a PR. I'm happy to review it. I think you should wait until #2053 (comment) is implemented since this will change the translation pipeline a bit.

});

it("should render without rounding", () => {
Expand Down