Originally Posted by Klingo
1) List professions, respectively re-use the different tabs from the Craft Bag. Getting the name from Filter Types seems still safe.
|
Yes, this is relatively safe, as long as the filters remain available. But don't hardcode the enum value, these are not so unlikely to change sometimes.
Lua Code:
-- SI_ITEMFILTERTYPE17 = "Enchanting"
GetString("SI_ITEMFILTERTYPE", ITEMFILTERTYPE_ENCHANTING)
Originally Posted by Klingo
4) Group the different repair kits under one common name. Reading a hook point and cut off the colon at the end, because there is no native string for "Repair Kit(s)".
Lua Code:
-- SI_HOOK_POINT_STORE_REPAIR_KIT_HEADER = "Repair Kits:" string.sub(GetString(SI_HOOK_POINT_STORE_REPAIR_KIT_HEADER),0,-2) -- "Repair Kit"
|
I wouldn't do this. You can't be sure that there will be a colon in other languages. There might be some multi-byte character (like an innocent non-breaking space), and this would make the string ill-formed UTF-8.
edit: oh, you're cutting not just the colon, but the "s", too. Well that is plain wrong, different languages form plurals in different ways
edit 2: no you're not, I got confused by the comment "Repair Kit". sub(s, 1, -2) cuts one byte.