ThaPwned / WCS

Warcraft: Source using Source.Python to be faster, expandable, and flexible
GNU General Public License v3.0
30 stars 23 forks source link

Mistake in wcs_xtell and wcs_xcentertell, might prevent strings from being translated #50

Closed Xiazee closed 3 years ago

Xiazee commented 3 years ago

https://github.com/ThaPwned/WCS/blob/bfb53e2511083f92220a17f5d48a9df0f790a989/addons/source-python/plugins/wcs/core/helpers/esc/commands.py#L1427 https://github.com/ThaPwned/WCS/blob/bfb53e2511083f92220a17f5d48a9df0f790a989/addons/source-python/plugins/wcs/core/helpers/esc/commands.py#L1435

player.language returns 'english' for me. But the keys in messages are country codes instead such as 'en'. I assume this causes get to always return the default value of 'en', instead of returning a translated string.

Maybe the inner message was supposed to be a dictionary mapping language names to codes, like this:

languages = {
    'english':  'en'
}

If that were the case, the default value of 'en' would actually make sense.

I have not actually tested this with different languages, but i think i heard mentions of some strings not being translated.

ThaPwned commented 3 years ago

This should be fixed now. Could you verify it when you got the time?