-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
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.
- Fork the repository and clone your fork to your computer
- Create a new branch (you can name it with the name of your locale)
- Copy the contents of
api/locale/en.yml
file toapi/locale/<IDENTIFIER>.yml
, where IDENTIFIER is shorthand for the language you are adding, for example, French would befr.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. - [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×tamp=1642108413&lang=fr
) - Commit and push your changes to your fork
- 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
- Open
/api/locale/
and click the "Add file" dropdown button and select "Create new file"
- Copy the contents of
api/locale/en.yml
.
- 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 befr.yml
. Change the top most yaml keyen:
to your language's identifier and add translations for the strings provided in the file. Only alter the text enclosed in quotes.
- Add a message and create a new branch with your changes by clicking "Propose new file"
- 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. Seehe.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!
Metadata
Metadata
Assignees
Labels
Projects
Status