Findig "ingame used" text values for reuse in your addons
Hey there,
after I've had to learn this in the past I'd like to share the knowledge about the ingame texts (strings) that we are able to reuse in our addons, and thus don't need to re-translate them with our own texts. Find ingame used strings To find some ingame texts you are able to search them in the ESOUI source code. The filename is located here: Code:
esoui\ingamelocalization\localizegeneratedstrings.lua -Or browse through online at github- -> -Direct link to the localizations file "localizegeneratedstrings.lua"- Use ingame used strings in your addon To use a string from the lua file you need the unique constant name from the array "EsoStrings" Code:
EsoStrings = In your addon you're able to use this constant to get the localized string, depending on your game client's language then. Use the following function Code:
GetString(myStrings_SI_Constant) -> See description of param2 in post 2 of this thread Code:
GetString("myStrings_SI_Constant", param2) Example In order to show the localized text for the chosen constant SI_INPUT_LANGUAGE_ENGLISH (will translate to "English", "Anglaise", "Englisch" depending on your game client's language) Lua Code:
You're also able to use GetString() without assigning it to a local/global variable before. This way you can use the game texts inside your LAM menus e.g. and don't have to think about translations (except the non standard game languages like Portuguese, Italian and so on) Lua Code:
|
Nice writeup. Two small additions:
You don't need to pass the stringId as a string, unless you want to use the second argument to GetString: Lua Code:
You can directly assign the stringId in LAM since a few versions ago: Lua Code:
|
Hi, there.
And if i want, let's say not to add my own translations to each single area name in the game ? where do i find the constants for area names used for localization, cuz it seems to me they aren't in this file ? |
There are a lot of strings that are not defined in Lua. Some of them can be received via the API, but a lot of them are just not accessible.
In the case of zone names (if that is what you mean with areas), you can get a name for a zoneId via the GetZoneNameById api function. To get the zoneId of the map you are looking at, you can use GetCurrentMapZoneIndex and GetZoneId (on the return value). |
I would also add that you can add those constants in XML files, such as
Lua Code:
It will display Yes or its translation in your UI. |
All times are GMT -6. The time now is 01:00 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI