Skip to content

Commit 9643a98

Browse files
committed
Add README.md
1 parent ec8dacc commit 9643a98

File tree

3 files changed

+94
-2
lines changed

3 files changed

+94
-2
lines changed

ModLocalizer/Dumper.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ public Dumper(TmodFile mod)
2727

2828
public void Run()
2929
{
30+
try
31+
{
32+
Directory.Delete(_mod.Name, true);
33+
}
34+
catch
35+
{
36+
// ignored
37+
}
38+
3039
Directory.CreateDirectory(_mod.Name);
3140
Directory.CreateDirectory(GetPath("Items"));
3241
Directory.CreateDirectory(GetPath("NPCs"));

ModLocalizer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
[assembly: Guid("613f981d-c5dd-43d1-b0ff-057169a647c4")]
1616

17-
[assembly: AssemblyVersion("0.4.0.0")]
18-
[assembly: AssemblyFileVersion("0.4.0.0")]
17+
[assembly: AssemblyVersion("0.4.1.0")]
18+
[assembly: AssemblyFileVersion("0.4.1.0")]

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Mod Localizer for tModLoader
2+
3+
Mod localizer is a tool developed for players to create their own localized mod easily; it support mods of [tModLoader][tml] v0.10 or higher version.
4+
5+
## Introduction
6+
7+
As far as we know, tModLoader has added a new feature enabling mod to have its translations. However, it cannot be easily used since it needs you to know how to code and it only works with open-source mod.
8+
9+
But this tool solves these problems of tModLoader's internationalization feature:
10+
11+
* It can read `.tmod` files and generate game content (like *item names, tooltips and buff descriptions*) in **JSON format** in which format you can translate them into your language with comfort.
12+
13+
* After your translating, the tool will use your translation to modify contents inside .tmod files regardless whether it is open source.
14+
15+
* It doesn't require programming knowledges; all you have to know is how to use command line and edit files using editors like [VSCode][vscode].
16+
17+
## Usage
18+
19+
### `ModLocalizer --mode dump <Mod Name>`
20+
21+
**Example: `ModLocalizer --mode dump ExampleMod.tmod`**
22+
23+
Program will create a new folder which name is the same as that of mod file and output mod contents inside it.
24+
25+
### `ModLocalizer --mode patch --folder <content path> --language <language> [Mod file]`
26+
27+
**Example: `ModLocalizer --mode patch --folder ExampleModContent --language Chinese ExampleMod.tmod`**
28+
29+
Modify *ExampleMod.tmod* according to contents in `ExampleModContent` folder.
30+
31+
The folder option is mandatory when the program mode is **patch**, because program needs it to modify mod file.
32+
33+
You have seven languages for chosing:
34+
35+
* English
36+
* German
37+
* Italian
38+
* French
39+
* Spanish
40+
* Russian
41+
* Chinese (default)
42+
* Portuguese
43+
* Polish
44+
45+
They're case-sensitive: you must enter them as what exactly they are here.
46+
47+
If I chose **Chinese**, then my translations will only show when I use Chinese language in *Terraria Settings*.
48+
So you must carefully choose your language to let your translations work.
49+
50+
### For further usage, enter `ModLocalizer --help`.
51+
52+
## How to translate mod content
53+
54+
You might get something like this when translating mod:
55+
56+
```json
57+
{
58+
"TypeName": "ExampleBreastplate", // DO NOT EDIT THIS
59+
"Namespace": "ExampleMod.Items.Armor", // DO NOT EDIT THIS
60+
"Name": "Example Breastplate",
61+
"ToolTip": "This is a modded body armor.\nImmunity to 'On Fire!'\n+20 max mana and +1 max minions",
62+
"ModifyTooltips": []
63+
}
64+
```
65+
66+
You can modify anything except `TypeName`, `Method` and `Namespace`.
67+
68+
### File/Directory inside mode content folder
69+
70+
- `Info.json` contains build properties like mod version and descriptions.
71+
72+
- `ModInfo.json` contains properties of `*.tmod` files like mod name or version.
73+
74+
- `Items` contains item properties like item name and tooltip.
75+
76+
- `NPCs` contains NPC properties like name, chat texts and shop button texts.
77+
78+
- `Tiles` contains map entries which need to be translated.
79+
80+
- `Miscs` contains some other texts.
81+
82+
[vscode]: https://code.visualstudio.com/
83+
[tml]: https://forums.terraria.org/index.php?threads/1-3-tmodloader-a-modding-api.23726/

0 commit comments

Comments
 (0)