Jump to content

Calling getText() does not use my Translate file [Solved]


Ricks MLC

Recommended Posts

 I have a mod working in PZ and I would like to have translations for it, but they don't work for me.  I have in the mod file path: Zomboid\Workshop\RicksMLCExcessiveExuberance\Contents\mods\ExcessiveExuberance\media\lua\shared\Translate\EN\IG_UI_EN.txt

 

IG_UI_EN = {
    RicksMLC_EE_TraitName = "Excessive Exuberance",
}

In my code I have:

 

getPlayer():SayDebug(getText("RicksMLC_EE_TraitName"))

 

which causes the player to say the literal string:  "RicksMLC_EE_TraitName" instead of "Excessive Exuberance"

 

The console.txt file states that the file has been loaded:

 

LOG  : Mod         , 1666399741340> loading RicksMLC_ExcessiveExuberanceMod
LOG  : Mod         , 1666399741346> mod "RicksMLC_ExcessiveExuberanceMod" overrides media/lua/shared/translate/en/ig_ui_en.txt

 

So I don't know why it would not work.  I compared my code to other mods like FuelAPI and I can't see anything special that I might be missing.  Is there anything I need to call to initialise the Translate to work, or some other API I need?

 

[Edit] I forgot to ask: Do the files in the Translate/EN ... etc directories need to be one of the several already named ones from the base PZ (eg IG_UI_EN.txt) or can it be named any .txt file (eg: RicksMLC_EE_EN.txt) and PZ will read it?

Edited by Ricks MLC
Added follow up question
Link to comment
Share on other sites

  • Ricks MLC changed the title to [Solved] Calling getText() does not use my Translate file
  • Ricks MLC changed the title to Calling getText() does not use my Translate file [Solved]

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
×
×
  • Create New...