Community Forum

Missing Text in l10n

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created02.02.2011 12:16


Sven Köhler (sven18koehler) 02.02.2011 12:19
I creat new FruitType with

FruitUtil.registerFruitType("fertilizer", ...);

in moddesc

<l10n>
<text name="fertilizer">
<de>Kunstdünger</de>
<en>Fertilizer</en>
</text>
</l10n>

--> it works not!

I try this

g_i18n.texts["fertilizer"] = getXMLString(xmlFile, "modDesc.FruitI10n."..g_languageShort);

--> it works not!

This Error are inGame:

http://www.abload.de/image.php?img=lsscreen_2011_02_02_12e7pp.png


How I can fix it?

Sven



Stefan Geiger - GIANTS Software 04.02.2011 16:20
Ou this error is really unfortunate. There problem is that the code that creates this message is not ported to the new i18n system introduced in ls11 which should also take messages from mods. Unfortunately I don't see an easy way to bypass this error message.

There is one really hacky way. You could overwrite the function BaseMission.addWarning(text).

With a new function like this:

local oldAddWarning = BaseMission.addWarning;
local realI18NName = "Fertilizer";
BaseMission.addWarning = function(self, text)
assert(not g_i18n:hasText("fertilizer"));
if text == g_i18n:getText("fertilizer") .. g_i18n:getText("notAcceptedHere") then
text = realI18NName .. g_i18n:getText("notAcceptedHere");
end;
oldAddWarning(self, text);
end;


Note that it is important that you have NOT set the fertilizer i18n string, otherwise the code won't work.

Sven Köhler (sven18koehler) 04.02.2011 23:42
Thanks Stefan, for the answer! It work´s and the last Problem for this Mod are solved! :-)

Sven

Thomas Markmann (DeerePower) 03.07.2011 15:35


Thomas Markmann (DeerePower) 06.07.2011 21:31




Note: Log in to post. Create a new account here.