Repository: anuraghazra/github-readme-stats
Pull request #2782 (2023-06-07 07:09:32)

Fix no languages data node function docstring

vercel[bot]: [vc]: #L6XLV2GcLPg0c2NNatPTycbX8/UOnKNXrwiWLu4s4og=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJnaXRodWItcmVhZG1lLXN0YXRzIiwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL2dpdGh1Yi1yZWFkbWUtc3RhdHMtdGVhbS9naXRodWItcmVhZG1lLXN0YXRzLzYzVE41cFpSczluand3REZicnI1U2dHUDJnNkQiLCJwcmV2aWV3VXJsIjoiZ2l0aHViLXJlYWRtZS1zdGF0cy1naXQtZml4bm9sYS1mODIyNmMtZ2l0aHViLXJlYWRtZS1zdGF0cy10ZWFtLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Updated (UTC) |
| :--- | :----- | :------ | :------ |
| **github-readme-stats** | ✅ Ready ([Inspect](https://vercel.com/github-readme-stats-team/github-readme-stats/63TN5pZRs9njwwDFbrr5SgGP2g6D)) | [Visit Preview](https://github-readme-stats-git-fixnola-f8226c-github-readme-stats-team.vercel.app) | Jun 7, 2023 7:09am |


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/2782?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) Report
Patch coverage: **`100.00`**% and no project coverage change.
> Comparison is base [(`bdef1cc`)](https://app.codecov.io/gh/anuraghazra/github-readme-stats/commit/bdef1cccdd14aa6b4ea97aeb3f1c886955756199?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) 97.52% compared to head [(`28ea6cc`)](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/2782?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) 97.53%.

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master    #2782   +/-   ##
=======================================
  Coverage   97.52%   97.53%           
=======================================
  Files          24       24           
  Lines        4815     4819    +4     
  Branches      449      449           
=======================================
+ Hits         4696     4700    +4     
  Misses        118      118           
  Partials        1        1           
```


| [Impacted Files](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/2782?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra) | Coverage Δ | |
|---|---|---|
| [src/cards/top-languages-card.js](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/2782?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra#diff-c3JjL2NhcmRzL3RvcC1sYW5ndWFnZXMtY2FyZC5qcw==) | `100.00% <100.00%> (ø)` | |


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/anuraghazra/github-readme-stats/pull/2782?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Anurag+Hazra).


Patch:
diff --git a/readme.md b/readme.md
index 94e6a8a..1516ac1 100644
--- a/readme.md
+++ b/readme.md
@@ -154,8 +154,8 @@ You can look at a preview for [all available themes](./themes/README.md) or chec
 
 #### Responsive Card Theme
 
-[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
-[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
+[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#responsive-card-theme#gh-dark-mode-only)
+[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#responsive-card-theme#gh-light-mode-only)
 
 Since GitHub will re-upload the cards and serve them from their [CDN](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls), we can not infer the browser/GitHub theme on the server side. There are, however, four methods you can use to create dynamics themes on the client side.
 
@@ -342,11 +342,11 @@ Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
 
 ### Demo
 
-[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)
+![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)
 
 Use [show_owner](#customization) variable to include the repo's owner username
 
-[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show_owner=true)](https://github.com/anuraghazra/github-readme-stats)
+![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats&show_owner=true)
 
 # Top Languages Card
 
@@ -380,7 +380,7 @@ By default, only the byte count is used for determining the languages percentage
 -   `&size_weight=0&count_weight=1` - Orders by repo count
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&size_weight=0.5&count_weight=0.5)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&size_weight=0.5&count_weight=0.5)
 ```
 
 ### Exclude individual repositories
@@ -388,7 +388,7 @@ By default, only the byte count is used for determining the languages percentage
 You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repositories.
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io)
 ```
 
 ### Hide individual languages
@@ -396,7 +396,7 @@ You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repo
 You can use `&hide=language1,language2` parameter to hide individual languages.
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html)
 ```
 
 ### Show more languages
@@ -404,7 +404,7 @@ You can use `&hide=language1,language2` parameter to hide individual languages.
 You can use the `&langs_count=` option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 10 (inclusive), and the default is 5.
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&langs_count=8)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&langs_count=8)
 ```
 
 ### Compact Language Card Layout
@@ -412,7 +412,7 @@ You can use the `&langs_count=` option to increase or decrease the number of lan
 You can use the `&layout=compact` option to change the card design.
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)
 ```
 
 ### Donut Chart Language Card Layout
@@ -444,16 +444,16 @@ You can use the `&layout=pie` option to change the card design.
 You can use the `&hide_progress=true` option to hide the percentages and the progress bars (layout will be automatically set to `compact`).
 
 ```md
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)
 ```
 
 ### Demo
 
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)
 
 -   Compact layout
 
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)
 
 -   Donut Chart layout
 
@@ -469,7 +469,7 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro
 
 -   Hidden progress bars
 
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)
 
 # Wakatime Week Stats
 
@@ -484,13 +484,13 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
 
 ### Demo
 
-[![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok)](https://github.com/anuraghazra/github-readme-stats)
+![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok)
 
-[![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok&hide_progress=true)](https://github.com/anuraghazra/github-readme-stats)
+![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok&hide_progress=true)
 
 -   Compact layout
 
-[![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok&layout=compact)](https://github.com/anuraghazra/github-readme-stats)
+![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok&layout=compact)
 
 * * *
 
@@ -544,11 +544,11 @@ Choose from any of the [default themes](#themes)
 
 -   Top languages
 
-[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
+![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)
 
 -   WakaTime card
 
-[![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok)](https://github.com/anuraghazra/github-readme-stats)
+![Harlok's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=Harlok)
 
 * * *
 
diff --git a/src/cards/stats-card.js b/src/cards/stats-card.js
index 4761d02..bf0c2c8 100644
--- a/src/cards/stats-card.js
+++ b/src/cards/stats-card.js
@@ -165,7 +165,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
     },
     contribs: {
       icon: icons.contribs,
-      label: i18n.t("statcard.contribs") + " (last year)",
+      label: i18n.t("statcard.contribs"),
       value: contributedTo,
       id: "contribs",
     },
diff --git a/src/cards/top-languages-card.js b/src/cards/top-languages-card.js
index d854c95..a757114 100644
--- a/src/cards/top-languages-card.js
+++ b/src/cards/top-languages-card.js
@@ -661,9 +661,13 @@ const renderDonutLayout = (langs, width, totalLanguageSize) => {
 };
 
 /**
- * Creates the no coding activity SVG node.
+ * Creates the no languages data SVG node.
  *
- * @param {{color: string, text: string, layout: import("./types").TopLangOptions["layout"]}} The function prop
+ * @param {object} props Object with function properties.
+ * @param {string} props.color No languages data text color.
+ * @param {string} props.text No languages data translated text.
+ * @param {import("./types").TopLangOptions["layout"] | undefined} props.layout Card layout.
+ * @return {string} No languages data SVG node string.
  */
 const noLanguagesDataNode = ({ color, text, layout }) => {
   return `
@@ -676,11 +680,13 @@ const noLanguagesDataNode = ({ color, text, layout }) => {
 /**
  * Get default languages count for provided card layout.
  *
- * @param {import("./types").TopLangOptions["layout"] | undefined} layout Input layout string
- * @return {number} Default languages count for input layout
+ * @param {object} props Function properties.
+ * @param {import("./types").TopLangOptions["layout"]=} props.layout Input layout string.
+ * @param {boolean=} props.hide_progress Input hide_progress parameter value.
+ * @return {number} Default languages count for input layout.
  */
-const getDefaultLanguagesCountByLayout = (layout) => {
-  if (layout === "compact") {
+const getDefaultLanguagesCountByLayout = ({ layout, hide_progress }) => {
+  if (layout === "compact" || hide_progress === true) {
     return COMPACT_LAYOUT_DEFAULT_LANGS_COUNT;
   } else if (layout === "donut") {
     return DONUT_LAYOUT_DEFAULT_LANGS_COUNT;
@@ -714,7 +720,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
     layout,
     custom_title,
     locale,
-    langs_count = getDefaultLanguagesCountByLayout(layout),
+    langs_count = getDefaultLanguagesCountByLayout({ layout, hide_progress }),
     border_radius,
     border_color,
     disable_animations,
diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime-card.js
index 9c17a4c..396ede1 100644
--- a/src/cards/wakatime-card.js
+++ b/src/cards/wakatime-card.js
@@ -25,7 +25,10 @@ const languageColors = require("../common/languageColors.json"); // now works
 /**
  * Creates the no coding activity SVG node.
  *
- * @param {{color: string, text: string}} The function prop
+ * @param {object} props The function properties.
+ * @param {string} props.color No coding activity text color.
+ * @param {string} props.text No coding activity translated text.
+ * @return {string} No coding activity SVG node string.
  */
 const noCodingActivityNode = ({ color, text }) => {
   return `
diff --git a/src/translations.js b/src/translations.js
index c123eb3..cea5059 100644
--- a/src/translations.js
+++ b/src/translations.js
@@ -166,35 +166,35 @@ const statCardLocales = ({ name, apostrophe }) => {
       se: "Total antal issues",
     },
     "statcard.contribs": {
-      ar: "ساهم في",
-      cn: "参与项目数",
-      "zh-tw": "參與項目數",
-      cs: "Přispěl k",
-      de: "Beigetragen zu",
-      en: "Contributed to",
-      bn: "অবদান রেখেছেন",
-      es: "Contribuciones en",
-      fr: "Contribué à",
-      hu: "Hozzájárulások",
-      it: "Ha contribuito a",
-      ja: "貢献したリポジトリ",
-      kr: "전체 기여도",
-      nl: "Bijgedragen aan",
-      "pt-pt": "Contribuiu em",
-      "pt-br": "Contribuiu para",
-      np: "कुल योगदानहरू",
-      el: "Συνεισφέρθηκε σε",
-      ru: "Внёс вклад в",
-      "uk-ua": "Вніс внесок у",
-      id: "Berkontribusi ke",
-      ml: "സമർപ്പിച്ചിരിക്കുന്നത്",
-      my: "Menyumbang kepada",
-      sk: "Účasti",
-      tr: "Katkı Verildi",
-      pl: "Kontrybucje",
-      uz: "Hissa qoʻshgan",
-      vi: "Đã Đóng Góp",
-      se: "Bidragit till",
+      ar: "ساهم في (العام الماضي)",
+      cn: "贡献于（去年）",
+      "zh-tw": "參與項目數 （去年）",
+      cs: "Přispěl k (minulý rok)",
+      de: "Beigetragen zu (letztes Jahr)",
+      en: "Contributed to (last year)",
+      bn: "অবদান (গত বছর)",
+      es: "Contribuciones en (el año pasado)",
+      fr: "Contribué à (l'année dernière)",
+      hu: "Hozzájárulások (tavaly)",
+      it: "Ha contribuito a (l'anno scorso)",
+      ja: "貢献したリポジトリ （昨年）",
+      kr: "(작년) 기여",
+      nl: "Bijgedragen aan (vorig jaar)",
+      "pt-pt": "Contribuiu em (ano passado)",
+      "pt-br": "Contribuiu para (ano passado)",
+      np: "कुल योगदानहरू (गत वर्ष)",
+      el: "Συνεισφέρθηκε σε (πέρυσι)",
+      ru: "Внёс вклад в (за прошлый год)",
+      "uk-ua": "Зробив внесок у (за минулий рік)",
+      id: "Berkontribusi ke (tahun lalu)",
+      ml: "സമർപ്പിച്ചിരിക്കുന്നത് (കഴിഞ്ഞ വർഷം)",
+      my: "Menyumbang kepada (tahun lepas)",
+      sk: "Účasti (minulý rok)",
+      tr: "Katkı Verildi (geçen yıl)",
+      pl: "Kontrybucje (w zeszłym roku)",
+      uz: "Hissa qoʻshgan (o'tgan yili)",
+      vi: "Đã Đóng Góp (năm ngoái)",
+      se: "Bidragit till (förra året)",
     },
   };
 };


Test patch:
diff --git a/tests/renderStatsCard.test.js b/tests/renderStatsCard.test.js
index 25c5feb..0dd5883 100644
--- a/tests/renderStatsCard.test.js
+++ b/tests/renderStatsCard.test.js
@@ -348,7 +348,7 @@ describe("Test renderStatsCard", () => {
       document.querySelector(
         'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
       ).textContent,
-    ).toMatchInlineSnapshot(`"参与项目数 (last year):"`);
+    ).toMatchInlineSnapshot(`"贡献于（去年）:"`);
   });
 
   it("should render without rounding", () => {
diff --git a/tests/renderTopLanguages.test.js b/tests/renderTopLanguages.test.js
index c906dec..e9e43f2 100644
--- a/tests/renderTopLanguages.test.js
+++ b/tests/renderTopLanguages.test.js
@@ -331,12 +331,25 @@ describe("Test renderTopLanguages helper functions", () => {
   });
 
   it("getDefaultLanguagesCountByLayout", () => {
-    expect(getDefaultLanguagesCountByLayout("normal")).toStrictEqual(5);
-    expect(getDefaultLanguagesCountByLayout(undefined)).toStrictEqual(5);
-    expect(getDefaultLanguagesCountByLayout("compact")).toStrictEqual(6);
-    expect(getDefaultLanguagesCountByLayout("donut")).toStrictEqual(5);
-    expect(getDefaultLanguagesCountByLayout("donut-vertical")).toStrictEqual(6);
-    expect(getDefaultLanguagesCountByLayout("pie")).toStrictEqual(6);
+    expect(
+      getDefaultLanguagesCountByLayout({ layout: "normal" }),
+    ).toStrictEqual(5);
+    expect(getDefaultLanguagesCountByLayout({})).toStrictEqual(5);
+    expect(
+      getDefaultLanguagesCountByLayout({ layout: "compact" }),
+    ).toStrictEqual(6);
+    expect(
+      getDefaultLanguagesCountByLayout({ hide_progress: true }),
+    ).toStrictEqual(6);
+    expect(getDefaultLanguagesCountByLayout({ layout: "donut" })).toStrictEqual(
+      5,
+    );
+    expect(
+      getDefaultLanguagesCountByLayout({ layout: "donut-vertical" }),
+    ).toStrictEqual(6);
+    expect(getDefaultLanguagesCountByLayout({ layout: "pie" })).toStrictEqual(
+      6,
+    );
   });
 });