Open krypciak opened 7 months ago
This can't really be fixed.
If I don't patch the game files, the langlabels will be stuffed everywhere, including in inaccessible places like local variables and it will be too late to patch them. To patch the game files, Localize-Me need to know which language the game will use, otherwise it would have to load every language mod's files and it will be slow (and break the API, because the current API documents that methods are not called if your language is not selected). Some files will still block anyway, like fonts, because only one language mod can patch fonts.
One possible workaround is to not block loading game files if they do not contain lang labels, but that will only partially fix the issue. It turns out the v1.x branch does this, but that branch is like, going to die because ccloader v3 never took on. Maybe this specific patch can be cherry-picked.
Consider the example
plugin.js
:The code above causes a deadlock. It is caused by the following stack: https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L832 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L857 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L817 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L596 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L386 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L351 https://github.com/L-Sherry/Localize-me/blob/master/mod.js#L162 It ends up on
this.final_locale
is not resolved untilig.Lang#init
is executed, which happens afterprestart