Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Use Valve translations for names? #10

Open
ghost opened this issue Oct 25, 2021 · 2 comments
Open

[Suggestion] Use Valve translations for names? #10

ghost opened this issue Oct 25, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ghost
Copy link

ghost commented Oct 25, 2021

Instead of manually entering them or only English, maybe you could use TF2Econ_GetLocalizedItemName?
https://forums.alliedmods.net/showpost.php?p=2646354&postcount=10

@punteroo punteroo added enhancement New feature or request help wanted Extra attention is needed labels Oct 25, 2021
@punteroo
Copy link
Owner

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.

  1. Maintaining an SQLite Database for translations would be a solution, but would require updating constantly on each update which beats the purpose of this plugin being entirely made with TFEconData. Yes, there are still some updates needed such as Unusual Effect names and War Paint names, but this is nothing in comparison to updating an entire database. Even then this is something I'm looking to turn dynamic and let the plugin entirely update translations on runtime, but I do not have time to do this for now. (Again, PRs are welcome).
  2. Personal translation files already exist for this. Just not for item names.
  3. Internally parsing the entirety of 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 post

For 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.

@nosoop
Copy link

nosoop commented Oct 26, 2021

🏓

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants