1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

Updated titles, anchor links

This commit is contained in:
Matej Baco 2021-08-27 10:56:44 +02:00
parent be016ca400
commit ce87c9d1ca

View file

@ -4,8 +4,6 @@ This document is part of the Appwrite contributors' guide. Before you continue r
## Getting Started
### Agenda
Appwrite's Locale API, Email Templates ( and soon our Dashboard ) has support for returning responses in your own locale based on the value of the `X-Appwrite-Locale` header. Behind the scenes, we use the value of this header to find the correct translation file for the locale. This guide will walk you through the process of adding a new Locale to Appwrite.
You can help in three distinct ways:
@ -14,13 +12,13 @@ You can help in three distinct ways:
* Reviewing existing translations for correctness
## Prerequisites
## 1. Prerequisites
It's really easy to contribute to an open-sourced projects, but when using GitHub, there are a few steps we need to follow. This section will take you step-by-step through the process of preparing your own local version of Appwrite, where you can make any changes without affecting Appwrite right away.
> If you are experienced with GitHub or have made a pull request before, you can skip to `Generate the translations`.
### Fork the Appwrite repository
### 1.1 Fork the Appwrite repository
Before making any changes, you will need to fork Appwrite's repository to keep branches on the official repo clean. To do that, visit the [Appwrite Github repository](https://github.com/appwrite/appwrite) and click on the fork button.
@ -37,11 +35,11 @@ $ git clone COPIED_URL
Finally, you will need to create a `feat-XXX-YYY-translation` branch based on the `locale` branch and switch to it. The `XXX` should represent issue ID and `YYY` the language name.
## Generate the translations
## 2. Generate the translations
You can choose to contribute either directly on [**GitHub**](#contributing-with-github) or using [**POEditor**](#contributing-with-po-editor) if you prefer a GUI.
You can choose to contribute either directly on [**GitHub**](#2.1-manually-using-github) or using [**POEditor**](#2.2-visually-using-po-editor) if you prefer a GUI.
### Manually using GitHub
### 2.1 Manually using GitHub
> Skip this part and jump to PO Editor section if you want to use graphical interface.
@ -78,7 +76,7 @@ We maintain a [`locale branch`](https://github.com/appwrite/appwrite/tree/locale
3. **languages.php**
[languages.php](https://github.com/appwrite/appwrite/blob/locale/app/config/locale/languages.php) contains all the languages listed in **[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)**. You can use this link to find your language code when making a contribution for your language.
[languages.php](https://github.com/appwrite/appwrite/blob/locale/app/config/locale/languages.php) contains all the languages listed in **[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)**. You can use this file to find your language code when making a contribution for your language.
Great, let's start. First, find the code of the language you want to add. For example, if you want to add support for **Spanish**, you can find the code for Spanish in [languages.php](https://github.com/appwrite/appwrite/blob/locale/app/config/locale/languages.php#L202).
@ -96,7 +94,7 @@ Next, choose a reference language. If English is your reference language, copy t
}
```
### Visually using PO Editor
### 2.2 Visually using PO Editor
> Skip this part if you followed the GitHub approach
@ -126,9 +124,10 @@ Once you're happy with your translations, you can export them. Head over to the
> **Attention! 🛑** There are two JSON exports. Please make sure to export the one saying `Key-value JSON`. Refer to the screenshot if you are not sure which one is correct.
After exporting a JSON file, we need to rename it to follow the **[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)** standards. You can use this link to find your language code when making a contribution for your language. For example, Spanish translation should have file called `es.json`.
After exporting a JSON file, we need to rename it to follow the **[ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)** standards. You can use [languages.php](https://github.com/appwrite/appwrite/blob/locale/app/config/locale/languages.php) file to find your language code when making a contribution for your language. For example, Spanish translation should have file called `es.json`.
## Add the translations to the project
## 3. Add the translations to the project
Add your language code to [codes.php](https://github.com/appwrite/appwrite/blob/locale/app/config/locale/codes.php#L14) in the following format.
```php
@ -141,9 +140,9 @@ Finally, load your translation file in `init.php` by following a pattern similar
> Please make sure to keep both `codes.php` and `init.php` in the alphabetical order A-Z.
## Raise a pull request
## 4. Raise a pull request
First of all, commit the changes with the message `Added Slovak translations` and push it. This will publish a new branch to your forked version of Appwrite. If you visit it at `github.com/YOUR_USERNAME_appwrite`, you will see a new alert saying you are ready to submit a pull request. Follow the steps GitHub provides, and at the end, you will have your pull request submitted.
### 🤕 Stuck ?
## 🤕 Stuck ?
If you need any help with the contribution, feel free to head over to [our discord channel](https://appwrite.io/discord) and we'll be happy to help you out.