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

Create a script to update internal links of translated files #817

Closed
samajammin opened this issue Mar 14, 2020 · 7 comments
Closed

Create a script to update internal links of translated files #817

samajammin opened this issue Mar 14, 2020 · 7 comments
Labels
feature ✨ This is enhancing something existing or creating something new tooling 🔧 Changes related to tooling of the project

Comments

@samajammin
Copy link
Member

samajammin commented Mar 14, 2020

Prize Bounty

75 DAI

Challenge Description

Currently when adding a new language translation or updating an existing translation (e.g. #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 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

Additional context

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.

@samajammin samajammin added the feature ✨ This is enhancing something existing or creating something new label Mar 14, 2020
@samajammin samajammin added Type: Bounty tooling 🔧 Changes related to tooling of the project labels Apr 8, 2020
@samajammin
Copy link
Member Author

@think-in-universe you might like this bounty 😄

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 75.0 DAI (75.0 USD @ $1.0/DAI) attached to it as part of the ethereum fund.

@gitcoinbot
Copy link

gitcoinbot commented Apr 8, 2020

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 264 years, 8 months from now.
Please review their action plans below:

1) sebastiantf has started work.

will develop the script. Have experience in Javascript
2) antodp has started work.

Will build the script according to the bounty description

Learn more on the Gitcoin Issue Details page.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 75.0 DAI (75.0 USD @ $1.0/DAI) has been submitted by:

  1. @antodp

@samajammin please take a look at the submitted work:


@samajammin
Copy link
Member Author

Solved in #939. Thanks again @antodp!

@think-in-universe
Copy link
Contributor

@samajammin thanks for invitation 😄

it seems already done. thank you guys for the quick work~

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 75.0 DAI (75.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @antodp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ✨ This is enhancing something existing or creating something new tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

No branches or pull requests

3 participants