Jump to content

[translation] Some strings are not translated in game


Recommended Posts

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 ?

Sans titre.png

Sans titre 2.png

modinfo.lua modmain.lua

Edited by Gwido
Link to comment
Share on other sites

Posted (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 by Gwido
Link to comment
Share on other sites

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 by Rickzzs
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...