StrataSource / Portal-2-Community-Edition

Task tracker for Portal 2: Community Edition
https://www.portal2communityedition.com
150 stars 3 forks source link

Allow translations for packed subtitles #264

Open Milkman68 opened 4 years ago

vrad-exe commented 4 years ago

I'm assuming you saw me mention this on the BEE server, so let me clarify.

It's possible to pack subtitle files into maps, including for multiple languages. However, they will be ignored for any languages that are already in the game, making it impossible to add custom subtitles that way. The way some people have done it is by packing them in as an entirely separate language, then switching to that on map load. But that means only one "real" language can actually be used.

The fix for this would be to have the game load packed subtitles on top of the vanilla ones (like how Minecraft handles language files). That would cause them to automatically match the selected language, without any hacky workarounds.

RealityAnomaly commented 4 years ago

As long as the new subtitles are packed into VPKs, this should already work?

vrad-exe commented 4 years ago

And that's exactly the problem, that content in VPKs overrides content packed into maps. Also, in my testing, the new subtitles wouldn't be loaded in addition to the vanilla ones - they'd override them entirely, meaning you'd effectively have to include a copy of every vanilla subtitle as well. I understand that this is the way the search path system works (only the one in the highest search path will be loaded), but I think it would be fine to make an exception for language files, merging together the copies from all search paths, mounted games, and packed content.