Age of Exile [FABRIC]

Age of Exile [FABRIC]

422k Downloads

Constant strings in code instead of localization

dimon7147 opened this issue ยท 1 comments

commented

I translated all the lines from en_us.json, but it wasn't enough. I looked at the code, some of the text is just a constant string on English.
Even the words that are already in the localization file are not used. (For example, mmorpg.word.to is specified in the localization file, but the file com/robertx22/age_of_exile/database/data/stats/name_regex/BasicStatRegex.java uses just a constant string).
And there are a lot of such lines, you can look at the several screenshots, but this is only what I managed to find in a couple of minutes.
Another problem is that the localization file itself is made strangely. It is proposed to translate individual words that will be used in the whole sentence. It is impossible to do this correctly. But this problem has already been reported (#44).
image
image
image
image
image
image
image

commented

Another problem is that the localization file itself is made strangely.

Individual words work fine for most things, but I use sentences for others. And yes there's a few constant strings in the code as I aimed to develop updates fast and worry about localization after I'm done and had the time.

The spell is a tougher one too, as the description is automatically made. Maybe not the best choice I guess. The way it works is it combines the spell action's condition, action and target parameters into a readable sentence.

So a 5 damage aoe spell is: "|On hit|[condition] |deal 5 damage|[action] |to enemies in radius[target]

If i were to redo the system, I'd probably just opt for the full spell to be localized in the lang file, with the parameters themselves being declared differently, in a way to allow both the spell, and the lang file to call them.

So you could do "Cast a fireball, dealing [FireballDamage] fire damage to enemies in radius\n Radius: [FireballRadius]"

I didn't want to go with that way as It was error prone and more work. But I didn't really think of sentence structure of other languages.

Writing this for mahj in case he wants to redo it.