I completely get where you’re coming from. I did write in that maybe I’d write it “normal” except I wouldn’t use and/or/~ but everything else would be “normal”.
Also I’d be pretty close to the original on that, depending where data comes from ( if it’s locally defined, or called elsewhere depends on if it gets 1 underscore. If it’s part of a class which holds data like the language system, then it’s 2 – for _p.var, I’d use no underscore for that. I only use __ in a table / meta-table when it’s to hold data that shouldn’t normally be accessed )
Example Here’s the re-defined language meta-table / class. I rewrote it because the original was C based, and on top of that it doesn’t support multi-languages in game-modes which is one of the reasons why TTT wrote their own from the ground up. This basically keeps all original syntax while allowing “dictionaries”. I suggested to have this added into gmod to replace the C version, but Robot didn’t like the idea…
Default Language is “en” for English, so if you’re using a default language you don’t need to define anything and could just add stuff in. During my tests, I actually have addons which populate data into it properly.
And here’s a slightly newer version: https://dl.dropboxusercontent.com/u/26074909/tutoring/classes/class_language_new.lua which fixed an error if GetPhrase was called before Add, and added additional options for GetPhrase to allow string.Format to automatically be called within, etc. I’m going to extend it to allow automated usage of the build-in functions for plural, a/an, 1st, 2nd, etc based on certain replacers.
As you see, I use __ for the meta-table just like the built in __index is there, __type is for extended typing, and __default is for a default language in addition to the __dictionaries. They’re initialized within for auto-refresh compatibility. I don’t see it as too un-readable but I’ll make sure when I post a tut it’s more friendly.