Skip to content

Commit

Permalink
Add a way to translate the navigation sidebar (#76)
Browse files Browse the repository at this point in the history
* feat: add the ability to translate the navigation bar

Adds the abaility to translate the navigation bar to a different langauge

* fix: fix a bunch of markdown issues

Fix a bunch issues relating to using HTML in markdown, and convert code to use markdown rather than HTML

* fix: change the wording for translating navigation elements

* fix: change the wording and remove an admonition

I have changed the wording for translating the navigation elements and turned an admonition into plaintext

* fix: change the wording again for translating navigation elements

I forgot to add where to copy and paste navigation translations from, so this fixes that and fixes grammar issues
  • Loading branch information
stantios authored Feb 5, 2024
1 parent f3d8280 commit 84c8a8e
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 12 deletions.
49 changes: 49 additions & 0 deletions config/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ theme:
name: material
custom_dir: ../overrides
features:
- content.code.copy
- search.highlight
- search.suggest
palette:
Expand Down Expand Up @@ -61,6 +62,54 @@ plugins:
default: true
name: English
build: true
nav_translations:
Home: Home
About: About
Credits: Credits
Licensing: Licensing
Support: Support
Client Docs: Client Docs
Installing: Installing
Basic Usage: Basic Usage
Full-Screen Map: Full-Screen Map
Settings: Settings
Overview: Overview
Grid: Grid
Minimap: Minimap
Minimap Position: Minimap Position
Full-Screen Map: Full-Screen Map
Webmap: Webmap
Waypoint: Waypoint
Waypoint Beacons: Waypoint Beacons
Cartography: Cartography
Advanced Options: Advanced Options
Waypoints: Waypoints
Server Docs: Server Docs
Installing: Installing
Basic Usage: Basic Usage
Commands: Commands
Waypoint: Waypoint
Settings: Settings
Overview: Overview
Global Properties: Global Properties
Default Dimension Properties: Default Dimension Properties
Dimension - minecraft:overworld: Dimension - minecraft:overworld
Dimension - minecraft:the_nether: Dimension - minecraft:the_nether
Dimension - minecraft:the_end: Dimension - minecraft:the_end
Multiplayer: Multiplayer
Endpoints: Endpoints
Waypoint: Waypoint
Tools & Customisation: Tools & Customisation
Custom Mob Icons: Custom Mob Icons
Integrate your mod: Integrate your mod
JourneyMap Tools: JourneyMap Tools
Map a multiplayer server: Map a multiplayer server
Topographic: Topographic
UI Themes: UI Themes
Contributing: Contributing
Translate the mod: Translate the mod
Translate the docs: Translate the docs
Changelogs: Changelogs
- mike:
version_selector: true
- search
Expand Down
63 changes: 61 additions & 2 deletions docs/en/Contributing/translate-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You will have to make a few changes to the `mkdocs.yml` file in the config folde
1. Opening the `mkdocs.yml` file in the config folder
2. Scroll down until you see the variable name `languages` and input a new line like this:

```diff
```diff title="mkdocs.yml"
languages:
- locale: en
default: true
Expand All @@ -27,9 +27,68 @@ You will have to make a few changes to the `mkdocs.yml` file in the config folde

```

3\. You will also have to add translations to the navigation elements for French. To do this, please copy and paste the `nav_translations` section from the English to the French section. Here is an example:

```diff title="mkdocs.yml"
- locale: fr
default: false
name: Français
build: true
+ nav_translations:
+ Home: Home
+ About: About
+ Credits: Credits
+ Licensing: Licensing
+ Support: Support
+ Client Docs: Client Docs
+ Installing: Installing
+ Basic Usage: Basic Usage
+ Full-Screen Map: Full-Screen Map
+ Settings: Settings
+ Overview: Overview
+ Grid: Grid
+ Minimap: Minimap
+ Minimap Position: Minimap Position
+ Full-Screen Map: Full-Screen Map
+ Webmap: Webmap
+ Waypoint: Waypoint
+ Waypoint Beacons: Waypoint Beacons
+ Cartography: Cartography
+ Advanced Options: Advanced Options
+ Waypoints: Waypoints
+ Server Docs: Server Docs
+ Installing: Installing
+ Basic Usage: Basic Usage
+ Commands: Commands
+ Waypoint: Waypoint
+ Settings: Settings
+ Overview: Overview
+ Global Properties: Global Properties
+ Default Dimension Properties: Default Dimension Properties
+ Dimension - minecraft:overworld: Dimension - minecraft:overworld
+ Dimension - minecraft:the_nether: Dimension - minecraft:the_nether
+ Dimension - minecraft:the_end: Dimension - minecraft:the_end
+ Multiplayer: Multiplayer
+ Endpoints: Endpoints
+ Waypoint: Waypoint
+ Tools & Customisation: Tools & Customisation
+ Custom Mob Icons: Custom Mob Icons
+ Integrate your mod: Integrate your mod
+ JourneyMap Tools: JourneyMap Tools
+ Map a multiplayer server: Map a multiplayer server
+ Topographic: Topographic
+ UI Themes: UI Themes
+ Contributing: Contributing
+ Translate the mod: Translate the mod
+ Translate the docs: Translate the docs
+ Changelogs: Changelogs
```

This codeblock includes English translations. In this case, you would need to translate the English words after the colon into French. I have left them English as an example.

!!! note "Note"

The instructions above only apply if you are translating to French. Please apply these intructions to the relative language you are translating to.
The instructions above only apply if you are translating to French. Please apply these instructions to the relative language you are translating to.

## **Creating a new folder**

Expand Down
14 changes: 9 additions & 5 deletions docs/en/Tools and Customisation/custom-mob-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ JourneyMap 5.3+ uses the mob's entity texture resource location and substitutes

*Note: If you are a player and you want to provide your own icons similiar to older versions of JourneyMap, you'll need to put together a [simple resource pack](http://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack) in a zip file. See the Instructions for Resource Pack Authors below.*

!!! note "Note"

If you are a player and you want to provide your own icons similar to older versions of JourneyMap, you'll need to put together a [simple resource pack](http://minecraft.gamepedia.com/Tutorials/Creating_a_resource_pack) in a zip file. See the Instructions for Resource Pack Authors below.

## **Instructions for Mod Authors**

You can now provide icons to JourneyMap for your mod's mobs. Here's how:

- JourneyMap 5.3+ will look in your mod jar for icons in <code>/assets/modname/textures/entity_icon</code> .
- JourneyMap 5.3+ will look in your mod jar for icons in `/assets/modname/textures/entity_icon`.
- Icons should be transparent PNG files. Other sizes are usually supported, but 16x16 pixels is recommended.
- The folder structure and filenames for your icons must mirror the folder structure and filename for your mob textures in <code>/assets/modname/textures/entity</code>.
- The folder structure and filenames for your icons must mirror the folder structure and filename for your mob textures in `/assets/modname/textures/entity`.

For example:

Expand All @@ -45,15 +49,15 @@ For example:
│ kobold_blue.png
```

Why is the above necessary? JourneyMap uses the ResourceLocation returned by <code>net.minecraft.client.renderer.entity.Render.getEntityTexture()</code> as the unique way to identify a mob for any mod. Providing icons with a similar same path and name keeps things as simple as possible.
Why is the above necessary? JourneyMap uses the ResourceLocation returned by `net.minecraft.client.renderer.entity.Render.getEntityTexture()` as the unique way to identify a mob for any mod. Providing icons with a similar same path and name keeps things as simple as possible.

## **Instructions for Resource Pack Authors**

You can use a resource pack to provide icons to JourneyMap 5.3+ for any Minecraft mobs or mod mobs. Here's how:

- JourneyMap will look in your resource pack zip for icons in <code>/assets/<modname>/textures/entity_icon</code> .
- JourneyMap will look in your resource pack zip for icons in `/assets/<modname>/textures/entity_icon`.
- Icons should be transparent PNG files. Other sizes are usually supported, but 16x16 pixels is recommended.
- The folder structure and filenames for your icons must mirror the folder structure and filename for mob textures in minecraft or other mods in <code>/assets/<modname>/textures/entity</code>.
- The folder structure and filenames for your icons must mirror the folder structure and filename for mob textures in minecraft or other mods in `/assets/<modname>/textures/entity`.

For example, if you want to provide custom icons for both Minecraft mobs and a mod called "coolmod", the mob textures for both would along these lines:

Expand Down
4 changes: 1 addition & 3 deletions docs/en/Tools and Customisation/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ Players can add waypoints by clicking on specially-formatted text in chat. (Han

For example:

<code>
NPC says: "Here's where I buried my loot:" [name:"treasure", x:1212, y:70, z:456, dim:0]
</code>
`NPC says: "Here's where I buried my loot:" [name:"treasure", x:1212, y:70, z:456, dim:0]`

The chat text itself is not changed, but is turned into a link for players with JourneyMap. Hover text shows it can be clicked to create a waypoint, or shift-clicked to show on the full screen map.

Expand Down
2 changes: 1 addition & 1 deletion docs/en/Tools and Customisation/multiplayer-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ As of JourneyMap 5.1.3, there is no server-side mechanism for generating a map o
- In JourneyMap, run **J > Actions > Automap** for all regions. Keep in mind Automap will do just the dimension you're in, and only the surface if you're on the surface. Or if you're underground, only the vertical slice (chunk), you were in when you kicked off Automap. If you want to Automap multiple slices or dimensions, move to the corresponding area and run Automap again.
- If you're intending to share the results with other players, note that any waypoints you create will go into the same folder as the map image tiles.

When it's done, the generated map image tiles and waypoints will be in <code>.minecraft/journeymap/data/sp/{worldname}</code>. To use the results when connecting to the server again, you'll need to copy that folder's contents to the one JourneyMap uses for your server connection: <code> .minecraft/journeymap/data/mp/{servername}</code>. If you want to share the results with other players, simply zip up the folder and give them these instructions.
When it's done, the generated map image tiles and waypoints will be in `.minecraft/journeymap/data/sp/{worldname}`. To use the results when connecting to the server again, you'll need to copy that folder's contents to the one JourneyMap uses for your server connection: `.minecraft/journeymap/data/mp/{servername}`. If you want to share the results with other players, simply zip up the folder and give them these instructions.
2 changes: 1 addition & 1 deletion docs/en/Tools and Customisation/topographic.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## **Overview of Topographic Maps in JourneyMap**

JourneyMap's Topographic Maps let you see the elevation contours of your world. You can customize the topographic map properties and colors in (''.minecraft/journeymap/config/5.2/journeymap.topo.config'') according to what looks best to you, or what you want to emphasize.
JourneyMap's Topographic Maps let you see the elevation contours of your world. You can customize the topographic map properties and colors in (`.minecraft/journeymap/config/5.2/journeymap.topo.config`) according to what looks best to you, or what you want to emphasize.

Here's how it works:

Expand Down
1 change: 1 addition & 0 deletions docs/en/Tools and Customisation/ui-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Create images 2x larger than the sizes you specify in the theme.json file. This
Modpacks can provide a theme for users by creating a theme folder just like the above. If a modpack author so wishes, they can also designate that theme to be the default theme for users who are using JourneyMap 5 for the first time.

This can be done by creating this file: .minecraft/journeymap/icon/theme/default.theme.config

The contents of the file provide the theme folder name, json file name, and the name designated within the json file, like so:

```json
Expand Down

0 comments on commit 84c8a8e

Please sign in to comment.