ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   Get ItemName in multiple languages (https://www.esoui.com/forums/showthread.php?t=7568)

Marify 01/15/18 06:07 PM

Get ItemName in multiple languages
 
Hi :)

[Goal]
I want to acquire an ItemName in multiple languages without reloading the UI.


[Details]
I want to retrieve the name in English and Japanese by calling ItemName()
UI will be reloaded when calling SetCVar(). :(

Do you know how to acquire a name by another means?

Lua Code:
  1. -- get English
  2. SetCVar("language.2", "en")
  3. d("ItemName(en)=" .. GetItemName(bagId, slotIndex))
  4.  
  5. -- get Japanese
  6. SetCVar("language.2", "jp")
  7. d("ItemName(jp)=" .. GetItemName(bagId, slotIndex))

[Other]
Usually, when you play, /script SetCVar ("language.2", "en")
Enter language to switch languages. (Audio is Japanese)

So, I think that the system contains English item names.

Dolgubon 01/15/18 06:25 PM

This is not possible. When you use SetCVar to change the language, it reloads the ui and uses a different set of files for the language stuff. So when you're not in the language you can't access that stuff. Thus, the only other way would be to hardcode it, but that might not be feasible if you need many different item names.

Marify 01/15/18 07:25 PM

Thank you very much. :)
I will give up and think in the direction to do hard coding

Rhyono 01/15/18 07:44 PM

If you're thinking of hard coding every item's name, just know you're going to need to break it into multiple sub-tables or you run the risk of lua issues due to how ZOS has it setup and that it'll be very unwieldy.

Dolgubon 01/15/18 08:25 PM

Quote:

Originally Posted by Rhyono (Post 33609)
If you're thinking of hard coding every item's name, just know you're going to need to break it into multiple sub-tables or you run the risk of lua issues due to how ZOS has it setup and that it'll be very unwieldy.

Oh yeah don't hardcode every item name. I mean hardcode for small amounts of items. Past a certain point it won't be worth it.

Ayantir 01/16/18 03:22 AM

As my other "colleagues" said it, please don't do this. too complicated and I don't even talk about translation issues.

Marify 01/16/18 04:48 AM

Thank you for your advice. :)

I will save only weapons, armor and accessories in the data.
And, I will try to destroy older data that is not being used.

Next, the item name was changed in past,
I also think about its response.

And what is ZOS? :confused:

Baertram 01/16/18 07:07 AM

ZOS = Developer of the lua code of ESO = Zenimax Online Studios


All times are GMT -6. The time now is 03:06 AM.

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