Skip to content

Commit

Permalink
Backport the minor fixes made from 5.9.x to 5.7.1 (#68)
Browse files Browse the repository at this point in the history
* Fix some minor issues with the translating the mod doc

* Fix a tiny grammar mistake
  • Loading branch information
stantios authored Feb 3, 2024
1 parent ca9a20d commit 5796177
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/en/Contributing/translate-docs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **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.
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 or play the JourneyMap mod in their own language.

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

Expand Down
34 changes: 14 additions & 20 deletions docs/en/Contributing/translate-mod.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **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.
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 or play the JourneyMap mod in their own language.

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

Expand All @@ -16,53 +16,47 @@ This Git repository contains the latest language files for JourneyMap: **[Journe
If your language file does not yet exist:

1. Copy the en_US.lang file
2. Rename it according the [[http://minecraft.gamepedia.com/Language Locale Code used by Mojang]]
2. Rename it according the [Locale Code](https://minecraft.wiki/w/Language) used by Mojang
3. Ensure it is saved with UTF-8 encoding (not ASCII or an ISO format)

The .lang file **must be saved in UTF-8 encoding** by using a text editor which can handle UTF-8 characters like [http://notepad-plus-plus.org/ Notepad Plus].
The .lang file **must be saved in UTF-8 encoding** by using a text editor which can handle UTF-8 characters like [Notepad Plus](https://notepad-plus-plus.org/).

If your language uses a character set which needs to be handled with Unicode characters, you can type them directly into the file. There is **no longer a need** to use Unicode hexadecimal Numeric Character Reference (NCR) codes (like \u0202).

**Example**: <code>jm.common.saving_map_to_file=Saving %1$s map to file...</code>
**Example**: `jm.common.saving_map_to_file=Saving %1$s map to file...`

<span style="color: red">**Incorrect**</span>: <code>jm.common.saving_map_to_file=\u8282\u80FD %1$s \u6620\u5C04\u5230\u6587\u4EF6...</code>

<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:
- Open your new .lang file in a text editor which can handle UTF-8 characters like [Notepad Plus](https://notepad-plus-plus.org/). 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
jm.common.mapgui_only_ready=Press [&sect;b%1$s&sect;f]. (Webserver disabled.)
</code>
`jm.common.chat_announcement= &sect;eJourneyMap:&sect;f %1$s`
`jm.common.mapgui_only_ready= Press [&sect;b%1$s&sect;f]. (Webserver disabled.)`

The sample lines above have the **keys** of "jm.common.chat_announcement" and "jm.common.mapgui_only_ready".

- Translate each **phrase** from the English phrase to your language, but do NOT alter the message keys. (Only change the text which come **after** the equals ("=") sign.)

**Example**: <code>example.key=This is a phrase.</code>
**Example**: `example.key=This is a phrase.`

<span style="color: green">**Correct**</span>: <code>example.key=Esta es una frase.</code>

<span style="color: red">**Incorrect**</span>: <code>example.llave=Esta es una frase.</code>

- Many of the phrases contain one or more numbered **parameters**. For example: "%1$s", "%1$d", "%2$s", etc. These are placeholders which will be replaced with a value when the message is displayed. You may reorder these parameters if it is required by the grammar rules of your language.
- Many of the phrases contain one or more numbered **parameters**. For example: "%1$s", "%1$d", "%2$s", etc. These are placeholders which will be replaced with a value when the message is displayed. You may reorder these parameters if it is required by the grammar rules of your language. For example:

For example:
<code>
jm.common.player_location=Location: %1$s , %2$s | Elevation: %3$s ( %4$s ) | Biome: %5$s
</code>
`jm.common.player_location=Location: %1$s , %2$s | Elevation: %3$s ( %4$s ) | Biome: %5$s`

When the above phrase is used by JourneyMap, the parameters will be substituted with actual location information, like so:

<code>
Location: 23,-98 | Elevation: 32 (2) | Biome: Desert
</code>
`Location: 23,-98 | Elevation: 32 (2) | Biome: Desert`

- If a phrase is missing from an existing language file, it will be prefixed with a "#" and have "???" as the phrase. You should remove the "#" prefix and then provide the correct phrase.

**Example**: <code># example.key=???</code>
**Example**: `# example.key=???`

<span style="color: green">**Correct**</span>: <code>example.key=Esta es una frase.</code>

Expand All @@ -72,8 +66,8 @@ Location: 23,-98 | Elevation: 32 (2) | Biome: Desert

## **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.
1. Use a zip program like 7-Zip to open your JourneyMap*.jar mod file.
2. Navigate down to `/assets/journeymap/lang` 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.

Expand Down

0 comments on commit 5796177

Please sign in to comment.