• Why y'all don't use the language library
    1 replies, posted
I was gonna start to localize an addon i'm working on and decided to look for examples of localization done in popular gamemodes and such. Doing that i found that all of the ones i looked (cinema, TTT, PAC3) did not use the language library native to gmod and instead chose to do their own tables and systems. TTT gave a brief explanation as to why but I don't think i understand. What kind of liberty is not possible using language.Add() and language.GetPhrase(), I mean for what i understand even if those 2 functions are not enough, you could build upon them to create your system. So why do y'all chose to create one from scratch?
The three major issues with the language library is that it is not available serverside, all language strings are stored in one table, you can't send localisation files to clients through FastDL. Valve created their localisation system for Source with the approach that the server would never need to see a translated string, and would be left with just the langtable key. This isn't a huge issue for Garry's Mod addons, but it does make console logs look a bit ambiguous if your keys aren't descriptive. Since all lang strings are stored in the same table, there is a high chance of running into conflicts with other addons if your keys aren't extremely unique, which is already a pretty prevalent issue with addon file-names, hook identifiers, net identifiers, NWVars, etc. The lack of support for sending localisation files to the client means all translation loading has to be done from Lua. Due to that, switching a language in-game requires each addon's language implementation to update their strings in a gmod_language convar callback. At that point, the effort in adding that could be spent creating a better language system.
Sorry, you need to Log In to post a reply to this thread.