I'd like to suggest possibly changing (or adding) the table keys used in Babble Class from English lowercase ("Warrior", "Mage", etc...) to the in-game supported English uppercase ("WARRIOR", "MAGE", etc...) used in all localizations.
Since the UnitClass function returns the localized class and the English uppercase class ("Warrior", "WARRIOR"), clients could now use both with Babble Class without having to do any type of string conversion or ReverseTranslation lookup to get the key. English uppercase is also used as keys in the games class color look up tables. This would however require current addons that use Babble Class to be updated, unless the new keys were added instead of changing the old ones.
One might ask where this would be beneficial and its in cases where you want to keep track of classes across clients and localizations, but be able to display the localized class. Currently a string conversion or ReverseTranslation lookup is needed with Babble Class to do this.
They used to be in there in the beginning but where removed since they messed up reverse lookup. Reverse lookup is very important wrt Babble-Class since some API calls (eg friends or guild) return loclized class names that can't be used for coloring in the class colors. But iirc Babble-Class has API calls for the upercase class names.
Elkano, I apologize but am not following what you are saying. A Reverse lookup gets the key, so how would it be affected if the key was changed to an uppercase value that is actually supported in the game? I believe the color methods support both the key or the localized class now, so I don't think it should be impacted.
I haven't checked the AceLocale code, but what Elkano says could be true, that it would confuse the reverse lookup -- you wouldn't know if you got back "Warrior" or "WARRIOR" from a reverse lookup.
Yes, that I understand which was why I proposed changing them =) I wasn't sure they could just be added because of that reason, but figured I 'd mention it in the original post just in case.
yeah, my post was based on adding the upper case version as additional localizations, not on replacing the exisiting ones.
Having a look at BabbleLib it's created as english to localized so changing to the uppercase versions would be inconsistent. And a call to BabbleClass:GetColor(class) will currently give you the color.
Though matching on the internal upper case names isn't a bad idea... :/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Since the UnitClass function returns the localized class and the English uppercase class ("Warrior", "WARRIOR"), clients could now use both with Babble Class without having to do any type of string conversion or ReverseTranslation lookup to get the key. English uppercase is also used as keys in the games class color look up tables. This would however require current addons that use Babble Class to be updated, unless the new keys were added instead of changing the old ones.
One might ask where this would be beneficial and its in cases where you want to keep track of classes across clients and localizations, but be able to display the localized class. Currently a string conversion or ReverseTranslation lookup is needed with Babble Class to do this.
Having a look at BabbleLib it's created as english to localized so changing to the uppercase versions would be inconsistent. And a call to BabbleClass:GetColor(class) will currently give you the color.
Though matching on the internal upper case names isn't a bad idea... :/