Better Questing

Better Questing

39M Downloads

Lang files

cyber01 opened this issue ยท 4 comments

commented

Hello, I have this problem:
There is a book of quests (standard json), I decided to do localization for several languages, but I encountered the following problem:
let's say i have a quest:
"desc: 8": "Title\nSame text\nText again\nMore text", I replaced everything in quotes with the variable mymodpack.quest.1.desc ie like this: "desc: 8": "mymodpack.quest.1.desc", and then created the en_us.lang file and added a line there: mymodpack.quest.1.desc = Title\nSame text\nText again\nMore text
Then with this file I made a resource pack and launched the game. Translation has loaded, but the problem is that the transfer to a new line does not work. Those. the text should be shown like this:
Title
Same text
Text again
More text
and it looks like this: Title\nSame text\nText again\nMore text
If I replace \n with a simple press Enter (move to a new line) (suppose I replace \n after Title with pressing Enter), then I lose all the text Same text\nText again\nMore text and only the Title remains.

How to solve this problem?

commented

It's not in the wiki because lang formatting isn't a standard I set nor specific to my mod. Even I don't remember all the symbol usages off the top of my head.

It's based on this if I remember correctly:
https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html

commented

Anyway thanks.

commented

Lang files use a different formatting for things like new lines and escape characters.
Instead of \n use %n

commented

Hmm, thanks, i try.
Please add it in wiki

It works