From ddcea1d11cb46c114e3a8833a7c1874bc3dd1c7d Mon Sep 17 00:00:00 2001 From: Bennett Date: Tue, 3 Mar 2020 10:57:59 +0100 Subject: Add Crowdin contributors to list of contributors (#429) * Enhance installation guide in README * Add CrowdIn Contributors to the list * Create script to add CrowdIn contributors * Fix lint * Fix ESLint error * Revert change of contributors per line * Revert change in badge template * Update All-contributors badge * Remove unrelated changes --- .all-contributorsrc | 159 ++++++++++++++++++++++++++------ README.md | 43 ++++++--- src/scripts/add-crowdin-contributors.js | 81 ++++++++++++++++ 3 files changed, 241 insertions(+), 42 deletions(-) create mode 100644 src/scripts/add-crowdin-contributors.js diff --git a/.all-contributorsrc b/.all-contributorsrc index 074adb826..764151b5d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -32,6 +32,29 @@ "review" ] }, + { + "login": "kytwb", + "name": "Amine Mouafik", + "avatar_url": "https://avatars0.githubusercontent.com/u/412895?v=4", + "profile": "https://twitter.com/kytwb", + "contributions": [ + "code", + "design", + "doc", + "ideas", + "bug", + "content", + "infra", + "userTesting", + "question", + "projectManagement", + "review", + "maintenance", + "platform", + "fundingFinding", + "blog" + ] + }, { "login": "adlk", "name": "Stefan Malzner", @@ -50,22 +73,17 @@ ] }, { - "login": "kytwb", - "name": "Amine Mouafik", - "avatar_url": "https://avatars0.githubusercontent.com/u/412895?v=4", - "profile": "https://twitter.com/kytwb", + "login": "Makazzz", + "name": "Makazzz", + "avatar_url": "https://avatars2.githubusercontent.com/u/49844464?v=4", + "profile": "https://github.com/Makazzz", "contributions": [ - "question", + "bug", "code", + "translation", + "content", "doc", - "ideas", - "maintenance", - "platform", - "projectManagement", - "review", - "infra", - "fundingFinding", - "blog" + "platform" ] }, { @@ -152,20 +170,6 @@ "platform" ] }, - { - "login": "Makazzz", - "name": "Makazzz", - "avatar_url": "https://avatars2.githubusercontent.com/u/49844464?v=4", - "profile": "https://github.com/Makazzz", - "contributions": [ - "bug", - "code", - "translation", - "content", - "doc", - "platform" - ] - }, { "login": "xthursdayx", "name": "xthursdayx", @@ -297,8 +301,107 @@ "contributions": [ "code" ] + }, + { + "login": "Ali_Shiple", + "name": "Ali M. Shiple", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/12895436/small/00917d09ca1b4b6d8e0ef36af07ecf6b.jpg", + "profile": "https://crowdin.com/profile/Ali_Shiple", + "contributions": [ + "translation" + ] + }, + { + "login": "elviseras", + "name": "elviseras", + "avatar_url": "https://www.gravatar.com/avatar/25c2cf0d8cb4a4141e71c3b8a2e9324f", + "profile": "https://crowdin.com/profile/elviseras", + "contributions": [ + "translation" + ] + }, + { + "login": "J370", + "name": "J370", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/14141203/small/7b12b5db419d8796450221c2eaaf6003.png", + "profile": "https://crowdin.com/profile/J370", + "contributions": [ + "translation" + ] + }, + { + "login": "keunes", + "name": "Koen", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/13018172/small/829115c606347b10218f34c637a2100c.png", + "profile": "https://crowdin.com/profile/keunes", + "contributions": [ + "translation" + ] + }, + { + "login": "leandrogehlen", + "name": "Leandro Gehlen", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/14099621/small/1d9503523839c310dbce0af3c226e894.jpeg", + "profile": "https://crowdin.com/profile/leandrogehlen", + "contributions": [ + "translation" + ] + }, + { + "login": "Matthieu42", + "name": "Matthieu42", + "avatar_url": "https://www.gravatar.com/avatar/735217ccccf11ba97573deee517ddb19", + "profile": "https://crowdin.com/profile/Matthieu42", + "contributions": [ + "translation" + ] + }, + { + "login": "nicky18013", + "name": "Nikita Bibanaev", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/13468928/small/2b31e7ac19645d950a79b33ffd5721b8.png", + "profile": "https://crowdin.com/profile/nicky18013", + "contributions": [ + "translation" + ] + }, + { + "login": "Tatjana1998", + "name": "Tatjana1998", + "avatar_url": "https://www.gravatar.com/avatar/ade202a04fcbb2c177e4f1d9936af29e", + "profile": "https://crowdin.com/profile/Tatjana1998", + "contributions": [ + "translation" + ] + }, + { + "login": "seayko", + "name": "tinect", + "avatar_url": "https://www.gravatar.com/avatar/65e2aef738ddf828f822d8463fd04918", + "profile": "https://crowdin.com/profile/seayko", + "contributions": [ + "translation" + ] + }, + { + "login": "Pusnow", + "name": "Wonsup Yoon", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/13514833/small/65f0b45587cc7e34f2827830cd324b16.jpeg", + "profile": "https://crowdin.com/profile/Pusnow", + "contributions": [ + "translation" + ] + }, + { + "login": "zutt", + "name": "zutt", + "avatar_url": "https://crowdin-static.downloads.crowdin.com/avatar/13320003/small/50fdf9f8c7e54a446925bd79696ea625.JPG", + "profile": "https://crowdin.com/profile/zutt", + "contributions": [ + "translation" + ] } ], "contributorsPerLine": 6, "skipCi": true -} +} \ No newline at end of file diff --git a/README.md b/README.md index ade6aeabb..700df2ac2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

GitHub Releases -Contributors +Contributors Open Collective backers Open Collective sponsors Build Status Windows @@ -237,22 +237,22 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d + - + - + - - + @@ -260,17 +260,32 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - + +
Bennett
Bennett

πŸ’» 🎨 πŸ“– πŸ€” 🌍 πŸ’‘ πŸ› πŸ–‹ πŸš‡ πŸ““ πŸ’¬ πŸ“† πŸ‘€
Amine Mouafik
Amine Mouafik

πŸ’» 🎨 πŸ“– πŸ€” πŸ› πŸ–‹ πŸš‡ πŸ““ πŸ’¬ πŸ“† πŸ‘€ 🚧 πŸ“¦ πŸ” πŸ“
Stefan Malzner
Stefan Malzner

πŸ’» πŸ–‹ 🎨 πŸ“– πŸ€” πŸš‡ πŸ“† ⚠️ 🌍
Amine Mouafik
Amine Mouafik

πŸ’¬ πŸ’» πŸ“– πŸ€” 🚧 πŸ“¦ πŸ“† πŸ‘€ πŸš‡ πŸ” πŸ“
Makazzz
Makazzz

πŸ› πŸ’» 🌍 πŸ–‹ πŸ“– πŸ“¦
ZeroCool
ZeroCool

πŸ’» πŸ€”
rseitbekov
rseitbekov

πŸ’»
Peter Bittner
Peter Bittner

πŸ€” πŸ›
Peter Bittner
Peter Bittner

πŸ€” πŸ›
Justus Saul
Justus Saul

πŸ› πŸ€”
igreil
igreil

πŸ€”
Marco Lopes
Marco Lopes

πŸ€”
dayzlun
dayzlun

πŸ›
Tobias GΓΌnther
Tobias GΓΌnther

πŸ€”
AGCaesar
AGCaesar

πŸ“¦
Makazzz
Makazzz

πŸ› πŸ’» 🌍 πŸ–‹ πŸ“– πŸ“¦
AGCaesar
AGCaesar

πŸ“¦
xthursdayx
xthursdayx

πŸ’» πŸ“– πŸš‡ πŸ“¦
Gaboris
Gaboris

πŸ’¬ πŸ›
Ce
Ce

πŸ›
Patrick Curl
Patrick Curl

πŸ€”

Benjamin Staneck

🎨

ammarmalhas

πŸ› πŸ›‘οΈ

Steliyan Stoyanov

πŸ’» πŸ€”

Bror Winther

πŸ“–

Felix W. Dekker

πŸ“–

Sauceee

🎨
Benjamin Staneck
Benjamin Staneck

🎨
ammarmalhas
ammarmalhas

πŸ› πŸ›‘οΈ
Steliyan Stoyanov
Steliyan Stoyanov

πŸ’» πŸ€”
Bror Winther
Bror Winther

πŸ“–
Felix W. Dekker
Felix W. Dekker

πŸ“–
Sauceee
Sauceee

🎨
Lennart Weller
Lennart Weller

πŸ“¦
Andrzej Ressel
Andrzej Ressel

πŸ’»
Daniel Peukert
Daniel Peukert

πŸ’»
Ali M. Shiple
Ali M. Shiple

🌍
elviseras
elviseras

🌍
J370
J370

🌍
Koen
Koen

🌍
Leandro Gehlen
Leandro Gehlen

🌍
Matthieu42
Matthieu42

🌍
Nikita Bibanaev
Nikita Bibanaev

🌍
Tatjana1998
Tatjana1998

🌍
tinect
tinect

🌍

Lennart Weller

πŸ“¦

Andrzej Ressel

πŸ’»

Daniel Peukert

πŸ’»
Wonsup Yoon
Wonsup Yoon

🌍
zutt
zutt

🌍
diff --git a/src/scripts/add-crowdin-contributors.js b/src/scripts/add-crowdin-contributors.js new file mode 100644 index 000000000..7ad3df0ed --- /dev/null +++ b/src/scripts/add-crowdin-contributors.js @@ -0,0 +1,81 @@ +/** + * Add CrowdIn Contributors to AllContributors list + * + * This script will add CrowdIn Contributors to the list of all contributors. + * As the CrowdIn API doesn't give good access to the data needed, this script + * requires you to manually execute a script on the members page of CrowdIn + * and paste its output into this script. + * + * Usage: + * 1. Open https://crowdin.com/project/getferdi/settings#members + * 2. Open the console and execute the script below: + +const members = []; +// All elements containing members +const membersEl = [...document.querySelectorAll('.ps-members-name')]; +// Remove the first 4 contributors as they are already in the list +for (let i = 0; i < 4; i += 1) { + membersEl.shift(); +} +membersEl.forEach((el) => { + const text = el.innerText; + let picture = el.querySelector('img').getAttribute('src'); + picture = picture.replace(/\?.+/, ''); + + // Check if the text includes a seperate username + if (text.includes('(')) { + const username = /(?<=\()\w*(?=\))/.exec(text)[0]; + const name = /^.*(?= \()/.exec(text)[0]; + + if (username) { + members.push({ + name: name || username, + login: username, + avatar_url: picture, + }); + return; + } + } + members.push({ + name: text, + login: text, + avatar_url: picture, + }); +}); + +// Output data to console +console.clear(); +console.log(JSON.stringify(members)); + + * 3. Paste the output of the script (JSON Array) below to set 'list' to that value + * 4. Execute this script using 'node src/scripts/add-crowdin-contributors.js' + * 5. Regenerate the README table using the CLI ('all-contributors generate') + * Please check if the generated data is ok and no data is lost. +*/ +const list = []; + +const fs = require('fs-extra'); +const path = require('path'); +const allContributors = require('all-contributors-cli'); + +const infoPath = path.join(__dirname, '../../.all-contributorsrc'); + +(async () => { + const info = await fs.readJSON(infoPath); + + for (const user of list) { + // eslint-disable-next-line no-await-in-loop + info.contributors = await allContributors.addContributorWithDetails({ + ...user, + contributions: ['translation'], + profile: `https://crowdin.com/profile/${user.login}`, + options: { + contributors: info.contributors, + }, + }); + } + + fs.writeJSON(infoPath, info, { + spaces: 2, + }); +})(); -- cgit v1.2.3-54-g00ecf