[Common] Add support for custom language files #191
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First step for #174 is creating a way to load custom language files to legacy fabric.
Registering
I can seem to find a "all loaded modids" function in the FabricLoader so now you have to register your modid yourself...
Not the most elegant solution, but a good one if you want to reuse these classes in your mod...
Json support
I've learnt my lesson and maintaining .json and .lang files both at the same time is a nightmare. So why don't I just downpatch the json lang files from 1.14?
Even better, both formats are supported and the hirarchy is as follows:
Lang files are still more preferred in the hirarchy, so that old resourcepacks with .lang still work, but in 99% of cases you can just use .json.
As to why I'm still supporting .lang? Well for LoTAS I created seperate lang files... so if LoTAS is ever ported to legacyfabric on the fly, you can be sure that this will work as well.
Lowercase
All lang files (Except Resourcepack .lang) are now being lowercased... This doesn't make much sense in 1.12.2 but in 1.10, all lang files had to be in en_US.lang... So to prevent future headaches I made everything like 1.14.