Quantcast GenerateFullSlotData for russian language setting - ESOUI
Thread Tools Display Modes
03/15/16, 02:27 PM   #1
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
GenerateFullSlotData for russian language setting

SHARED_INVENTORY:GenerateFullSlotData(nil, BAG_BACKPACK) behaves stranges with clients that are not en, de or fr.

If i retrieve the data and loop over the itemID's i get valid values for en, de en fr language settings. If i change from en to ru I also get valid itemID's. However if i change from de or fr to ru then i get NIL itemID's.

Is there something wrong in this utility ?
Lua Code:
  1. local bagCache = SHARED_INVENTORY:GenerateFullSlotData(nil, BAG_BACKPACK)
  2.             for slotIndex, itemData in pairs(bagCache) do
  3.                 if itemData.itemType == ITEMTYPE_TROPHY then
  4.                                       d(itemData.itemID)
  5.                                 end
  6.                         end
__________________
Your Crazy Dutch Addon Developer : ATLAS - Lost Treasure - Show Loot - Bank Stack - ATLAS Boss Logger

Donations : paypal
  Reply With Quote
03/15/16, 03:14 PM   #2
Wandamey
Guest
Posts: n/a
there is that from the API patch notes:

The $(language) substitution will be replaced with that two letter code. The new substitution $(officialLanguage) will always be “en” for custom languages, and the language code for official languages.
meaning if a string isn't translated yet (like probably a lot of item names) the English version is in use.

what is your "itemID" exactly ? i dont find one in SHARED_INVENTORY except maybe uniqueID? but idk how this one works. If it's the name then the quote aboves explains the error
  Reply With Quote
03/15/16, 03:22 PM   #3
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
the itemID is what it says the itemID of the corresponding item in the BackPack.

The problem is not with item Name, i don't use them, because of all the languages. That is why i use item ID's.

I suspect that actually no one really noticed, untill some guy made a bug report on my addon.

I also noticed in the current SHARED_INVENTORY there is no itemID defined, yet it works ... for en, de and fr ?
__________________
Your Crazy Dutch Addon Developer : ATLAS - Lost Treasure - Show Loot - Bank Stack - ATLAS Boss Logger

Donations : paypal
  Reply With Quote
03/15/16, 03:31 PM   #4
Wandamey
Guest
Posts: n/a
maybe some addon adds an itemID to the table? have you tried without any other addon loaded?

I don't recall not to have to get the info from bagID, slotIndex... but maybe i don't use the shorter way


Edit : I'm playing in English right now, client loaded in English, and i got only nil nil nil with your bit of code run in Click4Info

Last edited by Wandamey : 03/15/16 at 03:35 PM.
  Reply With Quote
03/15/16, 03:59 PM   #5
Randactyl
 
Randactyl's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 253
Can you go through PLAYER_INVENTORY.inventories[INVENTORY_BACKPACK].slots instead?
__________________
Randactyl | NA Megaserver | Blood for the Pact!

My Addons
Check out my GitHub repos to follow my latest changes and see some addons before they are released.
  Reply With Quote
03/15/16, 04:24 PM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 645
Did a grep through add-ons. The key itemID doesn't occur in ZOS UI at all; a few add-ons use itemID in private tables; only LostTreasure sets 'slotData.itemID' to the value extracted from itemLink.
  Reply With Quote
03/15/16, 04:39 PM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 645
Lua Code:
  1. LostTreasure/LostTreasure.lua +300 function LT:SlotAdded(bagId, slotIndex, slotData)
  2. LostTreasure/LostTreasure.lua +301  if not (bagId == BAG_BACKPACK and slotData and slotData.itemType == ITEMTYPE_TROPHY) then return end
  3. LostTreasure/LostTreasure.lua +302
  4. LostTreasure/LostTreasure.lua +303  local isTreasureMap = zo_plainstrfind(zo_strlower(slotData.name), TREASURE_TEXT[lang])
  5. LostTreasure/LostTreasure.lua +304  local isSurveyMap = zo_plainstrfind(zo_strlower(slotData.name), SURVEYS_TEXT[lang])
  6. LostTreasure/LostTreasure.lua +305
  7. LostTreasure/LostTreasure.lua +306  if isTreasureMap or isSurveyMap then
  8. LostTreasure/LostTreasure.lua +307      local itemID = select(4, ZO_LinkHandler_ParseLink(GetItemLink(BAG_BACKPACK, slotIndex)))
  9. LostTreasure/LostTreasure.lua +308      slotData.itemID = tonumber(itemID)
  10. LostTreasure/LostTreasure.lua +309  end

It's a wild guess, but it may have something to do with how russian translation maps cyrillic to latin-1 because ESO doesn't allow using non-latin unicode characters directly, zo_strlower might be messing that up.
  Reply With Quote
03/15/16, 08:42 PM   #8
Wandamey
Guest
Posts: n/a
items names are not all translated in russian yet.
you have to use TREASURE_TEXT[en] to search on the string (see pic) for these items (treasures and surveys both)


maybe this could help... http://www.esoui.com/forums/showthre...light=trophies

i don't know if it is still valid with all the new items since the thread was made, but you'll beable to find an update in Dustman I think
Attached Thumbnails
Click image for larger version

Name:	maprussian.png
Views:	161
Size:	169.4 KB
ID:	710  

Last edited by Wandamey : 03/15/16 at 08:51 PM.
  Reply With Quote
03/16/16, 02:02 AM   #9
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
The problem is more that if you set your language to german or french first, and then move to another language like russian, the game somehow shows all the menus and stuff in the previous language, while you would expect it to be english.

For all the languages that are not en/de/fr i assume they are en for looking up itemnames and so on. However if you set your language from en->de->ru then it gets messed up. I have a feeling that it remembers the last official language you set.

Did not test on a german or french official install, but i assume that you go from such version to russian, that all the non translated text things are still in german or french.

Which leads me to the question, is there a way to determine the base language that a client is running in.

Anyways, as merlight mentioned, it is my own addon adding itemID to the table. Doh ... Been messing with so much code lately that i don't understand my own addons anymore ...
__________________
Your Crazy Dutch Addon Developer : ATLAS - Lost Treasure - Show Loot - Bank Stack - ATLAS Boss Logger

Donations : paypal
  Reply With Quote
03/16/16, 03:49 AM   #10
Wandamey
Guest
Posts: n/a
The localization system has changed and it's a bit weird now. For exemple I downloaded rueso, used the ru in the seetings but at first it loaded in English i had to SetCVar in game. then even when i went back to English my french special characters still displayed in russian .

I don't know how you got it working in English but you are comparing an untranslated name with local TREASURE_TEXT = {
en = "treasure map",
de = "schatzkarte",
fr = "carte au trsor",
ru = "apa copo",
}

and there are several ways of "changing" the langage, do you use SetCVar ingame or do you load the complete client in another language for you tries? I doubt users have 40Gb extra just for a (third) language? and chip said that the default "untranslated" would be English, but that is probably only when you load the client completely.

anyway, you can check if it's a map/Survey if it's blue, bound, unique + usable etc.... now that mobs trophies ain't usable anymore. (unique to exclude the new counterfait pardons)

Last edited by Wandamey : 03/16/16 at 04:25 AM.
  Reply With Quote
03/16/16, 04:10 AM   #11
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 645
Originally Posted by CrazyDutchGuy View Post
Doh ... Been messing with so much code lately that i don't understand my own addons anymore ...
Who never stared at their own code asking "who wrote this mess?"

Anyway, I'd either use Ayantir's heuristics, perhaps include a check for "^treasuremap_" or "_survey_" in texture name to be sure; or build a lookup table {itemID=>pinData} from LOST_TREASURE_DATA at startup -- that way you could quickly check whether an item is a map your add-on knows. Also, I wouldn't put itemID in the slotData, it's a shared namespace; just extract it from the itemLink where it's needed.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » GenerateFullSlotData for russian language setting

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