Skip to content

Commit

Permalink
Backport adding a way to translate the sidebar from 5.9.x to 5.7.1 (#78)
Browse files Browse the repository at this point in the history
* feat: add the ability to translate the navigation bar

Adds the ability 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
  • Loading branch information
stantios authored Feb 5, 2024
1 parent fe2b2bb commit b78adbf
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 23 deletions.
36 changes: 35 additions & 1 deletion 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,39 @@ 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
Full-Screen Map: Full-Screen Map
Webmap: Webmap
Waypoint: Waypoint
Waypoint Beacons: Waypoint Beacons
Cartography: Cartography
Advanced Options: Advanced Options
Server Docs: Server Docs
Installing: Installing
Basic Usage: Basic Usage
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
- mike:
version_selector: true
- search
Expand All @@ -86,8 +120,8 @@ nav:
- Waypoint Beacons: Client Docs/settings/waypoint-beacon.md
- Advanced Options: Client Docs/settings/advanced.md
- Server Docs:
- Basic Usage: Server Docs/basic-usage.md
- Installing: Server Docs/installing.md
- Basic Usage: Server Docs/basic-usage.md
- Tools & Customisation:
- Custom Mob Icons: Tools and Customisation/custom-mob-icons.md
- Integrate your mod: Tools and Customisation/integration.md
Expand Down
61 changes: 60 additions & 1 deletion docs/en/Contributing/translate-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
30 changes: 16 additions & 14 deletions docs/en/Tools and Customisation/custom-mob-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ JourneyMap only comes with mob icons for Vanilla Minecraft mobs. (There's no mag
## **Mob Icon Sources (Legacy)**

!!! note "Note"
This section is for JourneyMap 5.2 and older. It is no longer relevant for JourneyMap 5.3+.
This section is for JourneyMap 5.2 and older. It is no longer relevant for JourneyMap 5.3+.

Whenever JourneyMap encounters a mob without a known icon, it creates a blank placeholder file that you can replace with your own icon. Look for them here <code>.minecraft/journeymap/icon/entity/(set name)/ ...</code>
Whenever JourneyMap encounters a mob without a known icon, it creates a blank placeholder file that you can replace with your own icon. Look for them here `.minecraft/journeymap/icon/entity/(set name)/...`

If you view the folder tree with thumbnails displayed, it should be easy to spot the blank placeholder files. Simply find and replace them with your own mob icon. It must be a PNG file and should have the same dimensions as the one you are replacing (usually 32x32 pixels).

Or, you can create your own custom mob icon set in its own folder:

- Look in <code>.minecraft/journeymap/icon/entity/</code> for existing icon set folders, like "2D", "3D", or "Default" (JourneyMap 5.3+)
- Look in `.minecraft/journeymap/icon/entity/` for existing icon set folders, like "2D", "3D", or "Default" (JourneyMap 5.3+)
- Copy that folder and give it a new name, placing it in the same directory as above.
- Within the copied folder, you can optionally edit the <code>[[#sources.json|sources.json]]</code> file to define how new icon sources (mods and resource packs) will be handled.
- Within the copied folder, you can optionally edit the `[[#sources.json|sources.json]]` file to define how new icon sources (mods and resource packs) will be handled.
- Within the copied folder, replace existing PNG images with a newer version your own. Do not change the filename. It is highly recommended that you keep the image sizes the same (32x32 pixels).
- Restart Minecraft and go into (J > Options Manager > Fullscreen Map) or (J > Options Manager > MiniMap Preset). You will now be able to select your new mob icon set for these displays.

Expand All @@ -25,23 +25,25 @@ JourneyMap 5.3+ no longer uses folders of icons. Instead, it uses mob icons via

JourneyMap 5.3+ uses the mob's entity texture resource location and substitutes "/entity/" with "/entity_icon/" to look up the mob icon. Thus:

* Mob entity texture: <code>minecraft:textures/entity/pig/pig.png</code>
* Mob icon texture: <code>minecraft:textures/entity_icon/pig/pig.png</code>
- Mob entity texture: `minecraft:textures/entity/pig/pig.png`
- Mob icon texture: `minecraft:textures/entity_icon/pig/pig.png`

(or)

* Mob entity texture: <code>enderzoo:textures/entity/wither_cat.png</code>
* Mob icon texture: <code>enderzoo:textures/entity_icon/wither_cat.png</code>
- Mob entity texture: `enderzoo:textures/entity/wither_cat.png`
- Mob icon texture: `enderzoo:textures/entity_icon/wither_cat.png`

*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.*
!!! 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_icons</code> .
- JourneyMap 5.3+ will look in your mod jar for icons in `/assets/modname/textures/entity_icons` .
- 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 @@ -62,15 +64,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/journeymap-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can find the mod at <https://www.curseforge.com/minecraft/mc-mods/journeymap
Source code is available at <https://github.com/TeamJM/journeymap-tools> and you are encouraged to contribute!

- **MapSaver**: Save all region tile images to a single file, with optional resizing.
- **MapMerger**: Merge tiles from two directories (usually from different players). ''Not implemented yet, can you help'?'
- **MapMerger**: Merge tiles from two directories (usually from different players). "Not implemented yet, can you help?"

## **How to use JourneyMap Tools**

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.
3 changes: 1 addition & 2 deletions docs/en/Tools and Customisation/topographic.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Here's how it works:

**{World height} ÷ {Number of colors} = {Contour interval}**


So, given a **world height of 256** blocks, a palette of **32 colors** will create 32 elevation contours, each with a **contour interval of 8** blocks high.

- 1st color: y 0-7
Expand All @@ -23,7 +22,7 @@ So, given a **world height of 256** blocks, a palette of **32 colors** will crea

## **Customization**

The topographic maps config file </code>.minecraft/journeymap/config/5.2/journeymap.topo.config</code> can be edited with a simple text editor. You can make changes to it, save it, and see the results immediately in JourneyMap without a need to restart.
The topographic maps config file `.minecraft/journeymap/config/5.2/journeymap.topo.config` can be edited with a simple text editor. You can make changes to it, save it, and see the results immediately in JourneyMap without a need to restart.

The file has the following properties:

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 b78adbf

Please sign in to comment.