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

🗪 Add Translations to YouTube Cards #48

Open
DenverCoder1 opened this issue Oct 14, 2022 · 0 comments
Open

🗪 Add Translations to YouTube Cards #48

DenverCoder1 opened this issue Oct 14, 2022 · 0 comments
Labels
feature New feature or request good first issue Good for newcomers pinned Pinned long-term issue up-for-grabs

Comments

@DenverCoder1
Copy link
Owner

DenverCoder1 commented Oct 14, 2022

If you know a language not yet supported by GitHub Readme YouTube Cards, you can help by opening a PR!

All it takes to contribute is to translate two words.

See a list of currently supported locales at /api/locale/.

It is important that the translations are accurate and sound natural. There is also a preference to matching the translations shown on the YouTube website if possible.

The locale code added to the file should be a 2-letter abbreviation from ISO 639-1 or a 4-letter code with a language and country code (eg. ja or pt_BR). Anything appearing in this list should be fine.

Adding a locale

Option 1: Running locally

You may refer to CONTRIBUTING.md for details on installing dependencies and running the project locally.

  1. Fork the repository and clone your fork to your computer
  2. Create a new branch (you can name it with the name of your locale)
  3. Copy the contents of api/locale/en.yml file to api/locale/<IDENTIFIER>.yml, where IDENTIFIER is shorthand for the language you are adding, for example, French would be fr.yml.
  4. Change the top most yaml key en: to your language's identifier and add translations for the strings provided in the file. Only alter the text enclosed in quotes.
  5. [Optional] Run the project and add &lang=IDENTIFIER to a card URL to make sure it displays correctly (e.g. http://127.0.0.1:8000/?id=dQw4w9WgXcQ&title=Never+Gonna+Give+You+Up&timestamp=1642108413&lang=fr)
  6. Commit and push your changes to your fork
  7. Open a pull request for merging your branch into this repo's main branch, including a screenshot would be appreciated

Option 2: Using the GitHub website

  1. Open /api/locale/ and click the "Add file" dropdown button and select "Create new file"
    image
  2. Copy the contents of api/locale/en.yml.
    image
  3. Paste the contents of en.yml into the editor and add your locale's identifier as the filename followed by the .yml extension, for example, French would be fr.yml. Change the top most yaml key en: to your language's identifier and add translations for the strings provided in the file. Only alter the text enclosed in quotes.
    image
  4. Add a message and create a new branch with your changes by clicking "Propose new file"
    image
  5. Click "Create Pull Request" to open a pull request for merging your branch into this repo's main branch

Note
When adding a right-to-left language, direction: rtl should be added to the yaml file to ensure it will display correctly. See he.yml as an example.

Make sure to keep the spacing and formatting consistent.

You can see #70 for an example of what your pull request should look like.

Your locale will become available when your Pull Request is approved.

If you have any questions, feel free to ask!

@DenverCoder1 DenverCoder1 added feature New feature or request good first issue Good for newcomers up-for-grabs labels Oct 14, 2022
@DenverCoder1 DenverCoder1 pinned this issue Oct 14, 2022
anonimak added a commit to anonimak/github-readme-youtube-cards that referenced this issue Oct 14, 2022
anonimak added a commit to anonimak/github-readme-youtube-cards that referenced this issue Oct 14, 2022
@DenverCoder1 DenverCoder1 moved this from Todo to In Progress in GitHub Readme YouTube Cards Oct 14, 2022
@Yugal41735 Yugal41735 mentioned this issue Oct 15, 2022
5 tasks
@Sohaib-50 Sohaib-50 mentioned this issue Oct 15, 2022
5 tasks
@DenverCoder1 DenverCoder1 added the pinned Pinned long-term issue label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers pinned Pinned long-term issue up-for-grabs
Projects
Status: In Progress
Development

No branches or pull requests

1 participant