Workers Auto Approve
Create a script to update internal links of translated files
### Prize Bounty
### Challenge Description
Currently when adding a new language translation or updating an existing translation (e.g. https://github.com/ethereum/ethereum-org-website/pull/816), all internal links within the translated markdown files must be manually updated to point to the appropriate page (i.e. the translated page vs. the corresponding English page). For instance, a link to the /learn page within the /docs/sv/what-is-ethereum/index.md file must be updated from `/learn` to `/sv/learn` (so it points to the translated page, ethereum.org/sv/learn, not the English version at ethereum.org/learn). See [this commit](https://github.com/ethereum/ethereum-org-website/pull/816/commits/ed70dce695ec8b1399c5fddde09c3efabb84f34b) as an example.
Create a node script to automate these updates.
### Submission Requirements
The node script should take a language directory as an argument, e.g.:
yarn update-internal-links docs/translations/de/
This script should traverse all markdown files within the directory for internal links, e.g.
[some internal link](/learn/)
It should IGNORE all external links, e.g.
[some external link](https://someexternalsite.com/)
For each internal link:
- If the link does not contain the language directory passed in, add it (/learn/ —> /de/learn/)
- If the link does not have a trailing slash, add it (/de/learn → /de/learn/)
- If the link already contains the language directory, do nothing (/de/learn/ --> /de/learn/)
The script should check that the passed argument (the language directory) is in fact a valid language directory (e.g. by checking the directory names within /docs/translations/, or keys of the `locales` object in config.js).
**Describe alternatives you've considered**
It may be useful to check out the existing script at generateHeadingID.js as an example to work off.
### Judging Criteria
The prize will be awarded to the first valid submission.
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: