Gwido Posted March 21 Share Posted March 21 (edited) Hi. I'm a french player and try to make a translation mod on my own. It's my very first mod. :P I've translated many strings, and it works well on objects and actions. As I often use Wormwood, I've decided to translate it's skill tree. But strangely, the strings remains in english, in game. (as you can see in the screen below, some strings of the UI are translated, but the ones for skill title and description are not.) Did I have to make something special in one of the .lua file ? modinfo.lua modmain.lua Edited March 21 by Gwido Link to comment Share on other sites More sharing options...
Rickzzs Posted March 21 Share Posted March 21 GLOBAL.package.loaded['prefabs/skilltree_wormwood']=nil add this before you load strings Link to comment Share on other sites More sharing options...
Gwido Posted March 21 Author Share Posted March 21 (edited) 1 hour ago, Rickzzs said: GLOBAL.package.loaded['prefabs/skilltree_wormwood']=nil add this before you load strings Thanks for the reply. In which one ? Modmain ? Before the LoadPOFile ? I tried, and it does nothing. And is there others lines to add ? I guess I have to list all characters, but is there others elements of the game that need this type of line ? Edited March 21 by Gwido Link to comment Share on other sites More sharing options...
Rickzzs Posted March 22 Share Posted March 22 (edited) maybe also GLOBAL.package.loaded['prefabs/skilltree_defs']=nil You need to clean the cache like this, and let them reload. Actually your translation loads after them, that's why it doesn't take effect. OK so I find you cannot clean them all. The official code is local SKILLTREE_CHARACTERS = { "wilson", "woodie", "wolfgang", "wormwood", "willow", "wathgrithr", } for _, character in ipairs(SKILLTREE_CHARACTERS) do local BuildSkillsData = require("prefabs/skilltree_"..character) if BuildSkillsData then local data = BuildSkillsData(FN) if data then CreateSkillTreeFor(character, data.SKILLS) SKILLTREE_ORDERS[character] = data.ORDERS end end end setmetatable(SKILLTREE_DEFS, { __newindex = function(t, k, v) SKILLTREE_METAINFO[k].modded = true rawset(t, k, v) end, }) return {SKILLTREE_DEFS = SKILLTREE_DEFS, SKILLTREE_METAINFO = SKILLTREE_METAINFO, CreateSkillTreeFor = CreateSkillTreeFor, SKILLTREE_ORDERS = SKILLTREE_ORDERS, FN = FN} So you need to do this local defs=require 'prefabs/skilltree_defs' local SKILLTREE_CHARACTERS = { "wilson", "woodie", "wolfgang", "wormwood", "willow", "wathgrithr", } for _, character in ipairs(SKILLTREE_CHARACTERS) do local BuildSkillsData = require("prefabs/skilltree_"..character) if BuildSkillsData then local data = BuildSkillsData(defs.FN) if data then defs.CreateSkillTreeFor(character, data.SKILLS) defs.SKILLTREE_ORDERS[character] = data.ORDERS end end end Edited March 22 by Rickzzs Link to comment Share on other sites More sharing options...
Gwido Posted March 28 Author Share Posted March 28 On 3/22/2024 at 6:31 AM, Rickzzs said: maybe also GLOBAL.package.loaded['prefabs/skilltree_defs']=nil You need to clean the cache like this, and let them reload. Actually your translation loads after them, that's why it doesn't take effect. OK so I find you cannot clean them all. The official code is local SKILLTREE_CHARACTERS = { "wilson", "woodie", "wolfgang", "wormwood", "willow", "wathgrithr", } for _, character in ipairs(SKILLTREE_CHARACTERS) do local BuildSkillsData = require("prefabs/skilltree_"..character) if BuildSkillsData then local data = BuildSkillsData(FN) if data then CreateSkillTreeFor(character, data.SKILLS) SKILLTREE_ORDERS[character] = data.ORDERS end end end setmetatable(SKILLTREE_DEFS, { __newindex = function(t, k, v) SKILLTREE_METAINFO[k].modded = true rawset(t, k, v) end, }) return {SKILLTREE_DEFS = SKILLTREE_DEFS, SKILLTREE_METAINFO = SKILLTREE_METAINFO, CreateSkillTreeFor = CreateSkillTreeFor, SKILLTREE_ORDERS = SKILLTREE_ORDERS, FN = FN} So you need to do this local defs=require 'prefabs/skilltree_defs' local SKILLTREE_CHARACTERS = { "wilson", "woodie", "wolfgang", "wormwood", "willow", "wathgrithr", } for _, character in ipairs(SKILLTREE_CHARACTERS) do local BuildSkillsData = require("prefabs/skilltree_"..character) if BuildSkillsData then local data = BuildSkillsData(defs.FN) if data then defs.CreateSkillTreeFor(character, data.SKILLS) defs.SKILLTREE_ORDERS[character] = data.ORDERS end end end Sorry for the late answer. I'll try that. Too bad that it was not in the translation template. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now