• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

[Help] Localization.txt and item names/descriptions; what am I doing wrong?

DiscipleOfBryan

New member
UPDATE:

This issue appears to be caused by a bug.

__________________________________

I'm having an issue with localization...

I've (via modlet) added a new food item and added entries for its name and description in Localization.txt, even gave the item a specific "DescriptionKey" property, but neither the item's name nor description show up as expected.

Modlet/Config/Localization.txt:

Code:
Key,Source,Context,Changes,English,French,German,Klingon,Spanish,Polish
{REDACTED itemName},items,Food,New,"{REDACTED Item Display Name}",,,,,
{REDACTED itemNameDesc},items,Food,New,"{REDACTED Item Description}",,,,,
Modlet/Config/items.xml:

Code:
<configs>
<append xpath="/items">
	<item name="{REDACTED itemName}">
		<property name="Tags" value="food"/>
		<property name="HoldType" value="31"/>
		<property name="DisplayType" value="food"/>
		<property name="Meshfile" value="#Other/Items?Misc/parcelPrefab.prefab"/>
		<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
		<property name="Material" value="Mplants"/>
		<property name="Stacknumber" value="10"/>
		<property name="EconomicValue" value="70"/>
		<property name="EconomicBundleSize" value="5"/>
		<property name="CraftingIngredientTime" value="10"/>
		<property name="UnlockedBy" value="perkMasterChef"/>
		<property class="Action0">
			<property name="Class" value="Eat"/>
			<property name="Delay" value="1.0"/>
			<property name="Use_time" value="..."/>
			<property name="Sound_start" value="player_eating"/>
		</property>
		<property name="Group" value="Food/Cooking,CFFood/Cooking"/>
		<property name="CustomIcon" value="{REDACTED itemNameIcon}"/>
		<property name="DescriptionKey" value="{REDACTED itemNameDesc}"/>

		<effect_group tiered="false">
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$foodAmountAdd" operation="add" value="70"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="$waterAmountAdd" operation="add" value="15"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar="foodHealthAmount" operation="add" value="20"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="buffProcessConsumables"/>

			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar=".DiseaseRoll" operation="set" value="2"/><display_value name="dFoodPoisoningRisk" value=".02"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="ModifyCVar" cvar=".DiseaseRoll" operation="add" value="@$MetabolismResist"/>
			<triggered_effect trigger="onSelfPrimaryActionEnd" action="AddBuff" buff="buffIllFoodPoisoning01">
				<requirement name="RandomRoll" seed_type="Random" min_max="1,100" operation="LTE" value="@.DiseaseRoll"/>
			</triggered_effect>
		</effect_group>
	</item>
</append>
</configs>
Is there something I'm missing here? Assume no typos in the redacted parts, if any are present I'll be fixing them, just wondering about syntax/logic errors.

 
Last edited by a moderator:
If your description has a comma in it anywhere you'll need to surround it with quotation marks to pass the string in correctly.

Ex: DescKey,items,Food,EnChanged,"Blah, and Blah",,,,,

My modlet's Localization.txt appears basically the same as yours, except I kept the same number of commas as the original:

Ex: NameKey,items,Food,KgNone,"Actual Name",,,,,

 
If your description has a comma in it anywhere you'll need to surround it with quotation marks to pass the string in correctly.Ex: DescKey,items,Food,EnChanged,"Blah, and Blah",,,,,

My modlet's Localization.txt appears basically the same as yours, except I kept the same number of commas as the original:

Ex: NameKey,items,Food,KgNone,"Actual Name",,,,,
No commas present in the display strings, but thanks heaps for the tip that you can include them using "".

The difference I'm yet to try (needs server restart, currently have players) is adding in the extra commas for unused translations. I'd read here that:

For mod localization support, you only need to specify the heading that you are adding. For example, if your mod only contains localization for English, you do not need to specify the other language in the heading line.
But in any case, the next attempt will have the full header and blank strings for unused/unfinished translations. Will report back.

Thanks so much for the reply, it's been killing me waiting for an assist on this one xD

 
♥♥♥♥♥♥♥it!

Still nothing.

Modlet/Config/Localization.txt:

Code:
Key,Source,Context,Changes,English,French,German,Klingon,Spanish,Polish
{REDACTED itemName},items,Food,KgNone,"{REDACTED Item Display Name}",,,,,
{REDACTED itemNameDesc},items,Food,KgNone,"{REDACTED Item Description}",,,,,
I decided to encapsulate the strings in "" just to be safe. Note also that there are no curly brackets in the file itself.

 
I'm not sure what the problem might be.

Are you making new name keys and description keys and then referencing them, or overwriting existing ones?

 
Server don't pushes localization file to client, only xml files. For this reason localization modlet isn't pushed to client.

 
Back
Top