Open ghost opened 2 years ago
By having a quick read on your suggestion, seems like getting localized token IDs through TFEconData won't be eligible for use in menus, as stated in the linked post by @nosoop the same creator of said TFEconData.
Item names are not manually entered, they are dynamically obtained through memory.
For localizing menus, you'll need to translate them server-side, either by maintaining an SQLite database like TF2IDB, creating your own translation file, or internally parsing the translation files.
tf_english.txt
or other languages would be a really difficult and intensive task. There's too much memory to keep in mind when doing this, and would require some sort of technique to save this data somewhere as to not have the plugin eat up the entire server's memory space just for translation names. This is even stated by Dr. McKay on his parser as linked in the postFor now, I cannot include this sort of functionality for 2 reasons; I have tried in the past and don't really know or have the knowledge to do so at the moment, and even if I had I currently do not have time to actively work on it.
🏓
These days there's also the langparser extension, but as far as I can tell it just exposes an interface for it over C++ — it currently doesn't have any SourcePawn-native bindings, and anyone interested in tackling this would need to handle the parsing events themselves.
The server doesn't load translations into memory, so there's no way to access them short of reading the files.
Instead of manually entering them or only English, maybe you could use
TF2Econ_GetLocalizedItemName
? https://forums.alliedmods.net/showpost.php?p=2646354&postcount=10