ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Reusing ESO localization, but to what extend? (https://www.esoui.com/forums/showthread.php?t=8337)

Klingo 02/14/19 03:20 PM

Reusing ESO localization, but to what extend?
 
Hi

In the past I had every single word that was used in the addon put in my own translation files. While replacing them with the official ones from ESO itself (with: GetString(...)), I started to wonder to what extend this makes sense and when it is more wise to have custom translations for it.

Here are some examples with increasing uncertainty:


1) List professions, respectively re-use the different tabs from the Craft Bag. Getting the name from Filter Types seems still safe.
Lua Code:
  1. -- SI_ITEMFILTERTYPE17 = "Enchanting"
  2. GetString(SI_ITEMFILTERTYPE17)
  3. -- SI_ITEMFILTERTYPE18 = "Provisioning"
  4. GetString(SI_ITEMFILTERTYPE18)
  5. -- SI_ITEMFILTERTYPE19 = "Style Materials"
  6. GetString(SI_ITEMFILTERTYPE19)

2) Group the different glyphs under one common name. Reading the text from a gamepad category might already be more vague whether this value is always there?
Lua Code:
  1. -- SI_GAMEPADITEMCATEGORY13 = "Glyphs"
  2. GetString(SI_GAMEPADITEMCATEGORY13)

3) Group different "liquids" together under one common name. Here a text that would fit that such a group can be found from a customer service feedback category.
Lua Code:
  1. -- SI_CUSTOMERSERVICESUBMITFEEDBACKSUBCATEGORIES402 = "Potions & Poisons"
  2. GetString(SI_CUSTOMERSERVICESUBMITFEEDBACKSUBCATEGORIES402)

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:
  1. -- SI_HOOK_POINT_STORE_REPAIR_KIT_HEADER = "Repair Kits:"
  2. string.sub(GetString(SI_HOOK_POINT_STORE_REPAIR_KIT_HEADER),0,-2) -- "Repair Kit"


While the first two examples seem quite safe to me, I am not so sure with the third (and especially the fourth) one how reliable this really is. What would other developers recommend? Re-Use as much as possible from ESO to reduce custom localizations, or only take it from ESO when there is a 100% match?

Cheers
Klingo


PS: I took this as the base for finding keys: https://github.com/esoui/esoui/blob/...tedstrings.lua

Drummerx04 02/14/19 04:48 PM

If something exists already that makes sense to use, then go with that. In the grand scheme, loading a few extra strings into memory won't break the game... probably.

merlight 02/15/19 06:10 AM

Quote:

Originally Posted by Klingo (Post 37095)
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:
  1. -- SI_ITEMFILTERTYPE17 = "Enchanting"
  2. GetString("SI_ITEMFILTERTYPE", ITEMFILTERTYPE_ENCHANTING)


Quote:

Originally Posted by Klingo (Post 37095)
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:
  1. -- SI_HOOK_POINT_STORE_REPAIR_KIT_HEADER = "Repair Kits:"
  2. 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.

sirinsidiator 02/15/19 10:48 AM

I reuse quite a lot of ingame strings in AwesomeGuildStores and even do the "cut off a character at the end" thing (although I am working on getting rid of those). Never had a problem in the past 4 years, but I also wouldn't recommend using strings from the support sections of the game or some that are used in a different context in the vanilla UI.

I'd say texts that are tied into core systems are generally very unlikely to change and as a rule of thumb, the shorter it is, the safer it is to reuse.

Klingo 02/16/19 10:24 AM

Thanks for your feedback, and the recommendation with the hardcoded enum. Much appreciated!


All times are GMT -6. The time now is 08:57 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI