Thread Tools Display Modes
12/30/23, 11:11 PM   #1
moshulu
AddOn Author - Click to view addons
Join Date: Dec 2022
Posts: 6
[Video Tutorial] String Localization and Special Characters

Link to the video

Hello everyone,
I'm excited to announce the next installment of my video series on ESO addon development for SimpleClock. This video goes over how to localize your strings using the lang/ folder and GetString() to call different localized translations of strings. We also handle unexpected output from os.date(), which we use to populate the clock that the user sees.

I'm looking forward to seeing what you produce with these building blocks! If the information in the video helped you, let me know! I'd love to see what you have created with the information that I've presented.

Link to the video

I hope to see you ingame!

- @moshulu
  Reply With Quote
12/31/23, 08:31 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Thank you, I've made a sticky thread for video tutorials and added yours there:
https://www.esoui.com/forums/showthread.php?t=10768
  Reply With Quote
01/04/24, 07:38 AM   #3
moshulu
AddOn Author - Click to view addons
Join Date: Dec 2022
Posts: 6
@Baertram, thank you very much for your support! I have another few videos lined up - is it okay to update the sticky thread when they come out, or would you (or another mod) have to do that?
  Reply With Quote
01/04/24, 08:01 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Put them as answer below the sticky thread and I'll add them to the main post then.
thanks
  Reply With Quote
01/04/24, 08:13 AM   #5
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
btw your video about the GetString constants is not correct! It works but is not the best way to do it!!!


Instead of copy&paste the strings into your fr.lua file and using ZO_CreateStringId again, which will recreate the same constant:
You just need to reuse the already created stringIds (from your en.lua via ZO_CreateStringId) and ONLY add a new version 2 with the new text via function:

Code:
SafeAddString(stringId, text, version+1)
Lua Code:
  1. --en.lua--
  2. for stringId, stringValue in pairs(strings) do
  3.    ZO_CreateStringId(stringId, stringValue)
  4.    SafeAddVersion(stringId, 1)
  5. end
  6.  
  7.  
  8.  
  9. --de.lua / fr.lua / es.lua / ru.lua / zh.lua / jp.lua / ...--
  10. for stringId, stringValue in pairs(strings) do
  11.    SafeAddString(_G[stringId], stringValue , 2)      
  12. end

Last edited by Baertram : 01/04/24 at 08:15 AM.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » [Video Tutorial] String Localization and Special Characters


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