7cb90f8e82
* docs: editing and general fixes of medusa's learning resources * fix build script * update ui dependency * fix build * adjust next.js steps
50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
export const metadata = {
|
|
title: `Contribute by Translating Admins`,
|
|
}
|
|
|
|
# {metadata.title}
|
|
|
|
The Medusa Admin supports multiple languages, with the default being English. We highly appreciate your contribution by translation to other languages you're fluent with, as it ensures a wider support of languages.
|
|
|
|
This type of contribution is a no-code contribution, meaning you don't need advanced technical skills to contribute.
|
|
|
|
---
|
|
|
|
## How to Contribute Translation
|
|
|
|
1. Clone the [Medusa monorepository](https://github.com/medusajs/medusa) to your local machine:
|
|
|
|
```bash
|
|
git clone https://github.com/medusajs/medusa.git
|
|
```
|
|
|
|
If you already have it cloned, make sure to pull the latest changes from the `develop` branch.
|
|
|
|
2. Create a branch that'll be used to open the pull request later:
|
|
|
|
```bash
|
|
git check -b feat/translate-<LANGUAGE>
|
|
```
|
|
|
|
Where `<LANGUAGE>` is your language name. For example, `feat/translate-da`.
|
|
|
|
3. Create a new directory under `packages/admin-ui/ui/public/locales` with its name being the [ISO 2 character code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) of your language. For example, `da`. In the new directory, create the file `translation.json`.
|
|
|
|
4. Copy the content of the English translation file located at `packages/admin-ui/ui/public/locales/en/translation.json` and paste it in your new `translation.json` file.
|
|
|
|
5. In the file, leave the key names as-is, and only translate the values.
|
|
|
|
7. In the file `packages/admin-ui/ui/src/i18n/index.ts`, add the new language to the `supportedLanguages` array as an object. The object accepts two properties: `locale` for the ISO 2 character code, and `name` for the name of the language. The name of the language should be the translated name, not the English name. For example:
|
|
|
|
```ts title="packages/admin-ui/ui/src/i18n/index.ts"
|
|
export const supportedLanguages = [
|
|
// other languages...
|
|
{
|
|
locale: "da",
|
|
name: "Dansk",
|
|
},
|
|
]
|
|
```
|
|
|
|
8. Once you're done, push the changes into your branch and open a pull request on GitHub.
|