View Single Post
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: 5,004
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