Home
A lang file is a file that maps a set of terms, called keys
to a value
that can be used to make a software work in multiple languages.
An example of this from the Minecraft lang files.
If we take a peek at the lang file for en_us
(US English), we can see an entry with the value
"block.minecraft.chest": "Chest"
This maps the key block.minecraft.chest
to the name of the item, Chest
.
If we look at the same key in de_de
(Germany German), we can see the German translation:
"block.minecraft.chest": "Truhe"
.minecraft
FolderThe first step will be to go to your .minecraft
folder. To do this, you need to go to ~/.minecraft
on Linux or MacOS (%appdata%\.minecraft
on Windows)
Once there, you need to go into the versions
folder. You can then open the folder for the version that you want, in my case, 1.19.3
In this folder, there are two files named based on the version that you selected.
We are interested in the file that ends with .json
.
Open this file in your text editor of choice, if your text editor has a format feature, I'd highly recommend doing that, otherwise, you can use an online tool to format your JSON to make it readable, like jsonformatter.org. I'll be using jq, a CLI tool for JSON.
We are looking for the key called assetIndex
:
"assetIndex": {
"id": "2",
"sha1": "c492375ded5da34b646b8c5c0842a0028bc69cec",
"size": 390746,
"totalSize": 5487041912,
"url": "https://piston-meta.mojang.com/v1/packages/c492375ded5da34b646b8c5c0842a0028bc69cec/2.json"
}
There is a key called url
that we want to get and open in our web browser. For me, the link is https://piston-meta.mojang.com/v1/packages/c492375ded5da34b646b8c5c0842a0028bc69cec/2.json
This will open a page with a large JSON file.
If you're using a browser like Firefox, you should see something like the image below, but if you just see a bunch of text, you can use jsonformatter.org to view the contents by pasting the url that you opened in the last step.
Once you have the JSON loaded, you need to find the key that has your language. It should be in the format of minecraft/lang/<lang>.json
, where <lang>
is replaced by the code for the language you desire.
For this tutorial, I'll use the code de_de
for German.
"minecraft/lang/de_de.json": {
"hash": "5fdda38acd539260be76bded488726dc33856c91",
"size": 396446
}
Inside of the object, there are two things, we only care about the hash
key, as this tells us where our lang file is stored.
For me, the hash is 5fdda38acd539260be76bded488726dc33856c91
. Keep this value as we will need it.
Now we must return to the .minecraft
folder.
From there, we can navigate into assets/objects/
Now, take the first two digits of the hash that we got earlier. In my case, it's 5f
.
This will be the folder that we must go into. After that, the lang file should be the file with the exact same name as the hash.
Note: there may be other files with very similar names to the hash, these are not the correct file, make sure the filename matches exactly.
Now you can copy this file into another directory and rename it to something useful!