0

What format are the 1.8 .lang files? Are they proprietary?

Here is a snippet of one:

language.name=English
language.region=US
language.code=en_US

translation.test.none=Hello, world!
translation.test.complex=Prefix, %s%2$s again %s and %1$s lastly %s and also %1$s again!
translation.test.escape=%%s %%%s %%%%s %%%%%s
translation.test.invalid=hi %
translation.test.invalid2=hi %  s
translation.test.args=%s %s
translation.test.world=world
2
  • 1
    They look like they are in some sort of custom format - definitely not JSON (they would probably be a .json file otherwise, but technically don't need to be).
    – Timmy Jim
    Mar 7, 2021 at 1:28
  • If you could post the first dozen lines of the content of a .lang file, then I wouldn't need to own the Java edition to tell you what format it is ;)
    – Nolonar
    Mar 7, 2021 at 1:30

1 Answer 1

1

.lang files are stored as a giant JSON dictionary object of keys and values, being the 'key' is a particular translation string identifier, and the value being the text translated.

Here's a snippet from minecraft/lang/en_gb.json:

{
    "addServer.add": "Done",
    "addServer.enterIp": "Server Address",
    "addServer.enterName": "Server Name",
    "addServer.hideAddress": "Hide Address",
    "addServer.resourcePack": "Server Resource Packs",
    ...
    "tutorial.punch_tree.description": "Hold down %s",
    "tutorial.punch_tree.title": "Destroy the tree",
    "tutorial.socialInteractions.description": "Press %s to open",
    "tutorial.socialInteractions.title": "Social Interactions"
}

They used to be stored a giant key-value list seperated by the = (equal sign).

addServer.add=Done
addServer.enterIp=Server Address
addServer.enterName=Server Name
addServer.hideAddress=Hide Address
...
tutorial.socialInteractions.description=Press %s to open
tutorial.socialInteractions.title=Social Interactions

If you need a template to start with, go to:

%appdata%\.minecraft\assets\objects\bd\bdd551782a0ef71c2b04537fc9cad75abbbf7cba

And rename it to en_gb.json so that it is recognized by other programs. Note that the lang.json files change hashes between versions as Mojang adds/removes/changes some strings. The hash above is correct as of 1.16 (Mar 07, 2021).

Just in case: ... denotes a snippet cut because the whole file is too big to be pasted.

2
  • Ah, the one I looked at was from 1.12 and I guess they were still using the = sign format then, which is why I said it looked like a custom format (it was also a .lang file extension).
    – Timmy Jim
    Mar 7, 2021 at 15:45
  • I'm talking about the 1.8 lang files, sorry. I've updated my question to be more clear. I've tried to use the 1.8 lang files as JSON, but I got a single error saying that it wasn't JSON.
    – hf02
    Mar 8, 2021 at 3:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .