ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Translation Help (https://www.esoui.com/forums/forumdisplay.php?f=186)
-   -   Alchemy Tooltips translation needed (https://www.esoui.com/forums/showthread.php?t=9004)

Hyperioxes 03/01/20 04:56 AM

Alchemy Tooltips translation needed
 
Hi, I'm adding multi language support to my addon Alchemy Tooltips and I need these strings translated to other languages (except of german and polish translations which I've already made myself).

Lua Code:
  1. local strings = {
  2.  
  3.     AT_CheapestCombination = "Cheapest Combination: ",
  4.     AT_CraftingCost = "Crafting Cost: ",
  5.     AT_CantCraft = "This potion cannot be crafted, it can only be looted",
  6.     AT_SendHelp = "It appears I haven't added that potion/poison to addon's database yet. If you want to help, please mail one sample of this potion/poison to @Hyperioxes on PC EU. Attachment will be sent back after I write down potion/poison's ID",
  7. }

sirinsidiator 03/01/20 05:40 AM

Can't help you with the translations, but if it is ingame item names you want, why not store the item id and generate the label on addon load? That way you don't have to retranslate everything when they add new reagents, add a new language or change some label and it will automatically work with custom localization projects too.
All you need to do is build an item link from the id and then use GetItemLinkItemName and zo_strformat:
Lua Code:
  1. local itemId = 30148
  2. local link = ("|H0:item:%d:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"):format(itemId)
  3. local name = zo_strformat("<<t:1>>", GetItemLinkName(link))
  4. d(name) -- "Blue Entoloma"

Hyperioxes 03/01/20 05:57 AM

Quote:

Originally Posted by sirinsidiator (Post 40418)
Can't help you with the translations, but if it is ingame item names you want, why not store the item id and generate the label on addon load? That way you don't have to retranslate everything when they add new reagents, add a new language or change some label and it will automatically work with custom localization projects too.
All you need to do is build an item link from the id and then use GetItemLinkItemName and zo_strformat:
Lua Code:
  1. local itemId = 30148
  2. local link = ("|H0:item:%d:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"):format(itemId)
  3. local name = zo_strformat("<<t:1>>", GetItemLinkName(link))
  4. d(name) -- "Blue Entoloma"

You're right it will work much better, thanks a lot for help!


All times are GMT -6. The time now is 06:58 PM.

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