Copying localization

Place to get help with not working mods / modding interface.
evildogbot100
Fast Inserter
Fast Inserter
Posts: 155
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Copying localization

Post by evildogbot100 »

How do I access standard localization? Example : I want to make a copy but stronger rocket-fuel item that will be translated to TRANSLATE(rocket-fuel).."2". With TRANSLATE(rocket-fuel) means whatever string factorio originally translate rocket-fuel item name into.
321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Copying localization

Post by 321freddy »

Add this to your prototype:

Code: Select all

localised_name = {"", {"item-name.rocket-fuel"}, " 2"},
Works similarly with localised_description.

Localised strings are a table with the key as the first element. Keys are always written like "SECTION.ITEMNAME" where section is the section in the locale .cfg files.
When the key is an empty string the following table elements are used as is (they can also be localised strings).
You can read about localised string here.
Post Reply

Return to “Modding help”