-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom language hooks #1519
Comments
I'm not quite sure I understand all the use cases this would enable. Is it just about being able to provide multiple lang files for one mod? At the moment, the code tries to load exactly one Would your suggestion add additional modids, make Edit: Or add a way to specify "if the langName has no file, try that langName" (e.g. " if there's no es-mx, try es-es, then es")? |
@HenryLoenwind 2 examples i can think of is. {
"minecraft.item": {
"dye": {
"red": "Red Dye",
"green": "Green Dye"
}
}
} Which would result in: Second example would be that you could import translations from non json files too. Ofc you could have preprocessor resourcepacks that basically does that automatically (because F3 support and all). |
Ok, I leave evaluating that injection to the maintainers. Just one thing; you can inject your own language handling with: Language.inject(MyLangauge.wrap(Language.getInstance())); in a ReloadListener. That way, you can do whatever you want. If this were a common thing for mods to do, it would result in a horrible wrapping chain, but it isn't, so I see no harm in doing so. |
You can already split up your language files with ease -- it loads one per namespace, not one per mod ID. Just prefix/suffix your mod ID to make different namespaces, and boom, you've split up your language files. |
@lukebemish so how many new name spaces should i introduce? A few hundred? A few thousand? @HenryLoenwind eh sadly that wouldn't work well because forge actually has its own internal language loader included. just doing 1 side is not enough sadly. I am asking for a loading hook so i don't have to mixin into neo/forge internals to get things going ^^" |
There's no downside to adding more namespaces. Splitting it up into multiple files within one namespace, and splitting it into multiple namespaces, are really equivalent. |
@lukebemish it has a impact on anything that does a wildcard scan (wildcard => any namespace) though depending on how extremely that is done the impact is low. I give you that. Still doesn't solve the limitations of breaking compat with basically user generated resource packs not being supported. |
Not sure how user generated resource packs are any different here or how that would cause any issues at all? All lang files -- regardless of namespace -- are merged together in resource pack order. The namespace is purely for organization within a pack. |
@lukebemish if i create a inMemory resource pack that converts for example 100 files into 1 en_us because i don't want to have values that are hundreds/thousands of characters long with text formatting included (newline/coloring/etc) so its easier to edit for anyone then i can not support that for user resource packs because they are only working for in memory resource packs. In other words to make stuff work like you suggest it forces me to do folder spamming where i have hundreds of folders with hundreds of en_us.json files with only a single entry that is hundreds of characters long with text formatting etc in them. Or to clarify at that point i can just use MyClass.class.getResourceAsStream() because these files won't work with user resource packs anyways and is 100% incompatible with it anyways. What i am asking for is to allow loading data with the resource pack system still supported. At this point i explained it to death. |
You could also just have your in memory resource pack loader or whatever support multiple namespaces? I'm not seeing any issue you've mentioned that's not solvable with current systems |
@lukebemish ok let me put that out in a step by step action.
This is because the in memory resource pack only contains the mods resources. This applies to any solution you suggest. |
Why are you trying to redirect a single file? Either (a) make an in memory resource pack generated by existing resource packs, which is perfectly possible, (b) use a different reload listener instead of an in memory resource pack, or (c) if the processing is applying formatting, do that in code to the components instead. |
Anyways. All i am asking is for an official hook to make "mixins/asm hooks" not required to expand support. Anyways i explained it to death... I am done arguing with you specifically. |
Fuck it. Just to classify the level of support i asked: Good luck. |
Is the crux of the problem here just the giant lang entries? If so, maybe those should not be in a lang file. Someone suggested that if you were trying to convert an entire massive wikipedia page into a single lang file entry, that is more of a design problem with the mod. Instead, it would be easier for everyone involved, (modder and players), if you do something like |
@TelepathicGrunt Its not only long lang entires, but multiple reasons. About the wiki. |
Or let's put it in plain terms: What I am asking: Please provide a bit of flexibility because atm there is none... You simply have to go the mc way or you don't have lang support at all... |
o/
I know i asked for a while if we could allow for prefixes for language files, and it was said for the modloader it wouldn't make much of sense. Which is understandable.
What i think is a more reasonable request is if there was a proper way to hook into the language loading system, so when a language gets loaded that you could inject at least your own key/value pairs.
This is mainly a QoL feature where you could implement special loaders that could handle permutations (looking at #1264) a lot easier, or allow to separate large files from each others. (Wikis are the first thing that come to mind)
I am not asking for you to provide these systems to handle the cases.
All I am asking is, provide a global hook where appending of translations can be done, not even overriding existing translations.
So devs can include their own solutions is wanted.
The text was updated successfully, but these errors were encountered: