iw4_bot_warfare icon indicating copy to clipboard operation
iw4_bot_warfare copied to clipboard

Add rudimentary translation support

Open Bluscream opened this issue 4 months ago • 3 comments

Boiled down version of #71 with only the translation stuff.

Scripts used to generate the translation layer can be found here

Ideally one would use a proper localized_strings table. But at the time when i wrote the translations i did not know they can be used by mods and even today i'm still not sure how to use "proper" iw4 localizations

Bluscream avatar Feb 12 '24 10:02 Bluscream

This is the worst way possible, to do localization. Not only does this make NO practical sense when you take an overview look at the implementation that is:

  • Infinite if/else chain like Yandere dev (how are you the only person who hasn't seen that meme?)
  • Slow and inefficient string comparison exacerbated by the infinite if/else chain
  • Localization done in the source code???

This also makes no sense at a lower level because:

  • In the GSC VM, you are necessarily plugging every single string for every single language even ones the game doesn't need making the game run out of memory sooner and occupying precious space in the SL (string management system the game uses)
  • You always compile GSC files for languages you don't know are needed. In other words, if my game is in English and I ran your code it would end up compiling the GSC file meant for Russian players.

No sane person will merge this in its current state

It is shocking in its current state actually because the IW4 engine natively supports localized string 🤯

Look at the CoD 4 modding tools to learn how to do this properly. Scrap this PR and start over by using str files.

https://github.com/promod/CoD4-Mod-Tools/tree/master/raw/english/localizedstrings

diamante0018 avatar Mar 25 '24 19:03 diamante0018

I would like to clarify, what I meant to suggest is that if you were to do such a thing as introduce localization stuff to this mod you should use the native str system.

However, you have no indication this feature is even wanted or appreciated in this repository. You should first ask the admin of the project using the issue tracker to see if something can be done about any feature before wasting any of your time. Even if you were to do this PR right you don't know if it will ever get merged which is a big waste added on top of this already botched PR.

diamante0018 avatar Mar 25 '24 19:03 diamante0018

What are you even on about. I clearly stated in my initial post that this is not ideal and i had to do it this way because of lack of knowledge/proper digestable documentation. tldr; i would prefer localized strings and did gave that a short try but didnt get it working after fiddling with it for an hour. This pr however took me about an hour and actually resulting in working translations. If anyone with extensive iw4 localization knowledge wants to take on the task, they are free to refactor this if they feel like doing some good.

About your second point of this potentially not being wanted; it might be true that ineedbots does not want translations, but how does that matter actually? I created the code for it anyway out of necessity for my own servers and sharing is caring. The repo owner is always free to close any PR that he feels is out of scope (preferably with a short reasonig :eyes:) and admins that want translations so bad that they can live with unoptimal code can just yoink the modifications from this pr whenever they want.

If you find grammar errors, you can keep them (i'm on mobile) Also to you personally; The only productive thing you did in your comments to this PR is providing a link to some docs for everyone that stumbles upon this. And in response to your Yandere dev references, i dont like that guy either, but for his attitude rather than his code. Remember, the only thing worse than a bad solution is no solution :)

Bluscream avatar Mar 26 '24 18:03 Bluscream