Why getCurrentLanguage returns enum codes rather than real strings like "en", "de"?

Hi guys, I wonder what’s the reason behind your architectural decision to use enum codes for supported languages rather than return ISO language codes like “en”, “de”, “zh” and so on?
As I can see from the sources you already have this languages codes on both iOS and Android. Maybe on other platforms that’s not true, but iOS and Android are most likely most used platforms nowadays, are not?

I’m asking because I’ve encountered situation: when someone needs to extend list of supported languages he needs to change code of cocos2d-x framework itself, and I feel it’s fragile approach.
It would be much simpler if we got just language code (and maybe additionally country code) and then handle it as needed in our games.

Why not?

1 Like