Thread Tools Display Modes
01/15/18, 06:07 PM   #1
Marify
 
Marify's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2017
Posts: 27
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.
  Reply With Quote
01/15/18, 06:25 PM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
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.
  Reply With Quote
01/15/18, 07:25 PM   #3
Marify
 
Marify's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2017
Posts: 27
Thank you very much.
I will give up and think in the direction to do hard coding
  Reply With Quote
01/15/18, 07:44 PM   #4
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
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.
  Reply With Quote
01/15/18, 08:25 PM   #5
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
Originally Posted by Rhyono View Post
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.
  Reply With Quote
01/16/18, 03:22 AM   #6
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
As my other "colleagues" said it, please don't do this. too complicated and I don't even talk about translation issues.
  Reply With Quote
01/16/18, 04:48 AM   #7
Marify
 
Marify's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2017
Posts: 27
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?
  Reply With Quote
01/16/18, 07:07 AM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
ZOS = Developer of the lua code of ESO = Zenimax Online Studios
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Get ItemName in multiple languages

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off