Closed mkremins closed 10 years ago
How do you reckon this should be done? With a big Enum of all available translations? Or just some text?
Allowing translation values to be arbitrary strings seems more feasible than trying to explicitly enumerate all available translations. There's already a whole lot of translations available, and it seems likely that more will be added for every new feature in the core game.
Some more information about translations is available here.
Not only does it seem likely that more translations can/will be added, according to the post you linked resource packs can specify arbitrary translation key/value pairs, so using a string key seems like the best way to go.
Okay, so strings it is. Does anybody know what happens if you give an invalid translation string though? I mean if it kicks you that could be an issue..
@Kezz101 From my brief testing in my command testing world (vanilla 1.7.9), it looks like it will just display the translate string if it cannot map it to a value.
Valid language file entry:
Invalid language file entry:
@glen3b Sweet. Strings it is!
@Kezz101 @mkremins I've added support for these in my PR #28, let me know what you think.
See this post for details. Basically, we need an API method that allows users to specify
"translate"
values for message parts and have them be correctly rendered into the final message JSON.