Skip to content

Commit

Permalink
Backport translation work from 5.9.x to 5.7.1 (#59)
Browse files Browse the repository at this point in the history
* Backport translation work from 5.9.x to 5.7.1

* Remove whitespaces

* Fix a spelling mistake
  • Loading branch information
stantios authored Feb 2, 2024
1 parent 0813bf8 commit 56e09ec
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ Run one of the following commands to start the local documentation server:

1. `mkdocs serve -f ./config/en/mkdocs.yml`
2. `python -m mkdocs serve -f ./config/en/mkdocs.yml`

If you want to see the docs in another language, just replace en with your language name.
13 changes: 11 additions & 2 deletions config/en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ theme:
extra:
version:
provider: mike
alternate:

# Switch to English
- name: English
link: /en/
lang: en

markdown_extensions:
- admonition
Expand All @@ -56,7 +62,8 @@ plugins:
- glightbox
- mike:
version_selector: true
- search
- search:
lang: en

nav:
- Home: index.md
Expand Down Expand Up @@ -87,5 +94,7 @@ nav:
- JourneyMap Tools: Tools and Customisation/journeymap-tools.md
- Map a multiplayer server: Tools and Customisation/multiplayer-server.md
- Topographic: Tools and Customisation/topographic.md
- Translate: Tools and Customisation/translate.md
- UI Themes: Tools and Customisation/ui-themes.md
- Contributing:
- Translate the mod: Contributing/translate-mod.md
- Translate the docs: Contributing/translate-docs.md
79 changes: 79 additions & 0 deletions docs/en/Contributing/translate-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# **Translate the docs**

If you want to contribute towards JourneyMap, a good way to do that is to translate the docs and the mod. This can help people that do not speak or not know how to read English, be able to read the JourneyMap docs in their own language.

Instructions on how to translate the mod can be found [here](translate-mod.md)

## **Getting Setup**

To get started on translating the wiki, you will need to have a local environment ready for testing your translations. This can be done by following the steps shown in the [README](https://github.com/TeamJM/journeymap-docs#installing).

You will also have to create a new folder in the existing config folder with the name of your language. For example, en is English, fr is French, de is Deutsh, etc. In our example below, we will show how to add translations for French.

Make sure to copy and paste the `mkdocs.yml` file from the en directory to your newly created folder. You will also have to make a few changes to the `mkdocs.yml` file. This can be done by:

1. Opening the `mkdocs.yml` file in your newly created folder
2. Replace the `docs_dir` variable to the name of your language

```diff
- docs_dir: ../../docs/en
+ docs_dir: ../../docs/fr
```

3. Scroll down until you see the variable name `alternate` and input a new line like this:

```diff
# Switch to English
- name: English
link: /en/
lang: en
+
+ # Switch to French
+ - name: French
+ link: /fr/
+ lang: fr
```

4. Scroll down again until you see the variable name `search` and change the language from en to the language you are translating to. Here is an example for French:

```diff
- lang: en
+ lang: fr
```

You have now finished setting up yourself up to translate the docs.

## **Creating a new folder**

Now that you have set yourself up, you can now start translating the actual docs. To start, you will need to create a new folder in the docs directory with your language name. Here is an example of how to do this if you are translating the docs to French:

```text
├─ docs/
│ ├─ en/
│ │ ├─ About/
│ │ ├─ Client Docs/
│ │ ├─ Server Docs/
│ │ ├─ Tools and Customisation/
│ │ ├─ changelogs.md
│ │ ├─ index.md
│ │ └─ translate.md
│ │
│ └─ fr/
│ ├─ About/
│ ├─ Client Docs/
│ ├─ Server Docs/
│ ├─ Tools and Customisation/
│ ├─ changelogs.md
│ ├─ index.md
│ └─ translate.md
```

An easy way to do this is to create a folder with your language name and copy and paste the contents from the en directory to your newly created folder in the docs directory.

Once your folder with all the files have been created, you can actually start translating the docs.

## **Finishing steps**

You might have come here asking yourself, what do I do once I have finished translating? Well, the final step you would do is to PR your work to the main repo for us to review and merge if all of it looks great.

**Thank you very much for your hard work!**
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# **Translate the mod**

If you want to contribute towards JourneyMap, a good way to do that is to translate the docs and the mod. This can help people that do not speak or not know how to read English, be able to read the JourneyMap docs in their own language.

Instructions on how to translate the docs can be found [here](translate-docs.md)

## **I. Check the current language files**

This Git repository contains the latest language files for JourneyMap: **[JourneyMap Language Files](https://github.com/TeamJM/journeymap-lang)**.
Expand All @@ -24,7 +30,7 @@ If your language uses a character set which needs to be handled with Unicode cha
<span style="color: green">**Correct**</span>: <code>jm.common.saving_map_to_file=节能 %1$s 映射到文件...</code>

## **III. How to translate the .lang file**

- Open your new .lang file in a text editor which can handle UTF-8 characters like [http://notepad-plus-plus.org/ Notepad Plus]. You will see a series of **keys** and **phrases** separated by an equals (=) sign. For example:

<code>jm.common.chat_announcement= &sect;eJourneyMap:&sect;f %1$s
Expand Down Expand Up @@ -65,14 +71,14 @@ Location: 23,-98 | Elevation: 32 (2) | Biome: Desert
- Do not translate or remove the special character combinations used by Minecraft to change color. (&sect;b, &sect;f, &sect;e, etc.)

## **IV. How to test your translation**

1. Use a zip program like 7Zip to open your JourneyMap*.jar mod file.
2. Navigate down to <code>/assets/journeymap/lang</code> and add your language file (if new) or replace the older one.
3. JourneyMap will use the language you select in Minecraft. Select your language in Minecraft, and JourneyMap will use your new translation.
4. Please test your translation in Minecraft as best as you can. Don't worry about trying to provoke error messages, but please try to test as much as possible, including the Fullscreen Map controls (and tooltips), Options (and tooltips), and Web Map controls to confirm they are working.

## **V. How to submit your translation**

[Follow the instructions on Github](https://github.com/TeamJM/journeymap-lang#how-to-translate-journeymap)

**Thank you very much for your hard work!**
2 changes: 1 addition & 1 deletion docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ If you’d like a featureful, easy-to-use mapping mod then why not give JourneyM
- [Integrate your mod](Tools and Customisation/integration.md)
- [Make custom mob Icons](Tools and Customisation/custom-mob-icons.md)
- [Create a UI Theme (Skin)](Tools and Customisation/ui-themes.md)
- [Translate JourneyMap For Your Language](Tools and Customisation/translate.md)
- [Translate JourneyMap For Your Language](Contributing/translate-mod.md)

0 comments on commit 56e09ec

Please sign in to comment.