DEV Community

Cover image for Hacktoberfest 2023 Contributors Wanted: Additional Translations for the user-statistician GitHub Action
Vincent A. Cicirello
Vincent A. Cicirello

Posted on

Hacktoberfest 2023 Contributors Wanted: Additional Translations for the user-statistician GitHub Action

Table of Contents

Introduction

The user-statistician GitHub Action can generate an SVG with a detailed summary of your activity on GitHub. It is mentioned in the tools section of the awesome README awesome list. The SVG it generates includes general information about you (e.g., year you joined, number of followers, number you are following, most starred repository, etc), information about your repositories (e.g., numbers of stars and forks, etc), information about your contributions (e.g., numbers of commits, issues, PRs, etc), and the distribution of languages within your public repositories.

It is customizable in a variety of ways, such as color themes, custom colors, custom ordering of the sections and statistics within a section, including or excluding entire sections or individual statistics, etc. One of the ways that you can customize it is for locale. For this Hacktoberfest, I am hoping to further increase internationalization, and I'm looking for contributors who would like to translate the various section headings, labels, etc to additional languages.

Here is an example of what it generates (using one of the built-in Halloween themes):

Example

Current International Support

Last year, during Hacktoberfest 2022, contributors helped increase international support with the addition of 8 language translations bringing the total supported languages to the following 24:

locale code language
id Bahasa Indonesia
bn Bengali
nl Dutch
en English
fr French
de German
hi Hindi
hu Hungarian
it Italian
ja Japanese
ko Korean
lt Lithuanian
no Norwegian
or Odia
pl Polish
pt Portuguese
ro Romanian
ru Russian
sat Santali
sr Serbian
es Spanish
th Thai
tr Turkish
uk Ukrainian

Hacktoberfest 2023

There are currently 13 open issues for language translations. Additionally, if you'd like to contribute a translation to a language not already supported that doesn't already have an associated issue, you can start by submitting an issue.

The user-statistician GitHub Action is mostly implemented in Python. However, you can likely contribute even if you know very little Python (or even none for that matter). Each locale is defined within a JSON file. If you are a past contributor, you might remember all of the locales being defined in a single Python source file within a few Python dictionary objects. This was actually very tedious for me to merge Hacktoberfest PRs, since there were frequent conflicts (e.g., 2 or more contributors adding 2 or more different translations in the same position within a Python dictionary). To make things easier, a few weeks ago, I refactored to pull all of the translations out into JSON files, one per locale.

Here is an example of en.json for locale code en for the English language version:

{
  "titleTemplate": "{0}'s GitHub Activity",
  "categoryLabels": {
    "general": {
      "heading": "General Stats and Info",
      "column-one": null,
      "column-two": null
    },
    "repositories": {
      "heading": "Repositories",
      "column-one": "Non-Forks",
      "column-two": "All"
    },
    "contributions": {
      "heading": "Contributions",
      "column-one": "Past Year",
      "column-two": "Total"
    },
    "languages": {
      "heading": "Language Distribution in Public Repositories",
      "column-one": null,
      "column-two": null
    }
  },
  "statLabels": {
    "joined": "Year Joined",
    "featured": "Featured Repo",
    "mostStarred": "Most Starred Repo",
    "mostForked": "Most Forked Repo",
    "followers": "Followers",
    "following": "Following",
    "sponsors": "Sponsors",
    "sponsoring": "Sponsoring",
    "public": "My Repositories",
    "starredBy": "Starred By",
    "forkedBy": "Forked By",
    "watchedBy": "Watched By",
    "templates": "Templates",
    "archived": "Archived",
    "commits": "Commits",
    "issues": "Issues",
    "prs": "Pull Requests",
    "reviews": "Pull Request Reviews",
    "contribTo": "Contributed To",
    "private": "Private Contributions"
  }
}
Enter fullscreen mode Exit fullscreen mode

Contributing a language translation mostly involves creating a new JSON file named with the ISO 639-1 two-character code for the language, or for languages that don't have a two-character code, the ISO 639-2 three-character language code. Then within that JSON file, translating all of the string values. You also need to add the locale code to a Python set of supported locales within src/StatConfig.py.

There are detailed instructions for contributing a language translation within the README in the repository.

More Information

For more information about the user-statistician GitHub Action, see the other DEV posts in this series, as well as its GitHub repository and a webpage about the action, and please consider giving the repository a star:

GitHub logo cicirello / user-statistician

Generate a GitHub stats SVG for your GitHub Profile README in GitHub Actions

user-statistician

user-statistician

Check out all of our GitHub Actions: https://actions.cicirello.org/

About user-statistician Mentioned in Awesome README


























GitHub Actions
GitHub release (latest by date) Count of Action Users
Build Status
build samples CodeQL
Source Info
License GitHub top language
Contributors
GitHub contributors good first issue
Support
GitHub Sponsors Liberapay Ko-Fi

The cicirello/user-statistician GitHub Action generates a detailed visual summary of your activity on GitHub in the form of an SVG suitable to display on your GitHub Profile README Although the intended use-case is to generate an SVG image for your GitHub Profile README, you can also potentially link to the image from a personal website, or from anywhere else where you'd like to share a summary of your activity on GitHub. The SVG that the action generates includes statistics for the repositories that you own, your contribution statistics (e.g., commits, issues, PRs, etc), as well as the distribution of languages within public repositories that you own. The user stats image can be customized, including the colors such as with one of the built-in themes or your own set of custom…

user-statistician - Generate an SVG statistics card for your GitHub Profile README in GitHub Actions

The cicirello/user-statistician GitHub Action generates a detailed visual summary of your activity on GitHub in the form of an SVG, suitable to display on your GitHub Profile README. The SVG that the action generates includes statistics for the repositories that you own, your contribution statistics (e.g., commits, issues, pull requests, etc), as well as a pie chart showing the distribution of languages within public repositories that you own.

favicon actions.cicirello.org

Where You Can Find Me

Follow me here on DEV and on GitHub:

Or visit my website:

Vincent A. Cicirello - Professor of Computer Science

Vincent A. Cicirello - Professor of Computer Science at Stockton University - is a researcher in artificial intelligence, evolutionary computation, swarm intelligence, and computational intelligence, with a Ph.D. in Robotics from Carnegie Mellon University. He is an ACM Senior Member, IEEE Senior Member, AAAI Life Member, EAI Distinguished Member, and SIAM Member.

favicon cicirello.org

Top comments (6)

Collapse
 
sadeedpv profile image
Sadeedpv🥇

Hey, can you create an issue for the Malayalam translation of the project. It's my native language and is quite popular, I would love to see it up there!

Collapse
 
cicirello profile image
Vincent A. Cicirello

Of course. Here's a link to the issue.

Collapse
 
sadeedpv profile image
Sadeedpv🥇

Thanks! I was about to work on it, good to see someone already did!

Thread Thread
 
cicirello profile image
Vincent A. Cicirello • Edited

I wasn't sure if you were just suggesting it or if you wanted to work on it, or else I would have reserved it for you. You were certainly right that it would be of interest.

Thread Thread
 
sadeedpv profile image
Sadeedpv🥇

I just wanted to see my language up there 🤗

Collapse
 
viveksati profile image
VIVEK SATI

Successfully merged✅