How changing orginal Locale?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

How changing orginal Locale?

Post by Palaber1984 »

hello guys

I am from Germany and I am developing my own mod and therefor i wanted to know how to change the orignal German locale without touching the base locale?

Example, i wanted to change the original translation of the "electric-energy-distribution=Stromnetz" into "electric-energy-distribution=Strommasten" but i cant see changes in the game

In my Google Drive Puplic folder you can look the Orignal Locale and my Locale and the technology tree https://drive.google.com/drive/folders/ ... sp=sharing

A friend has shown me his mod where he do the same like me and he says that it works at him.


Can anyone help me please understanding and solving this problem?
THX

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: How changing orginal Locale?

Post by Deadlock989 »

Works for me. Did you put it in the right language folder, i.e. the language your game is using?
Image

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

My own translation cfg is in the folder called „de“ why doesn’t my translation overwrite the „de“ locale in the base folder?

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

Isn’t there anyone who can help me please!?

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: How changing orginal Locale?

Post by Deadlock989 »

Is anything from that locale file working? Or is it just that one thing missing?

If the latter, are you sure the entity/item/recipe in question is actually set to use it? Sometimes things inherit locale names from other things in a way that's not always intuitive, e.g. equipment recipes get their locale name and description from equipment-name and equipment-description, not recipe-name and recipe-description, unless you explicitly set the locales in the recipe prototype.

Do you have bad syntax in the file somewhere? Illegal characters? We can't help you much with just screenshots of text.
Image

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

i have not look at your tips for now but i will. what i want to say first is, that i loaded my friends mod and added my translation exact the same like in my locale in my friends locale and startet the game and now it works, but somehow not with my locale. but i will follow your tips at the beginning and try to find the issue. but it is getting me angry seeing how it works with the mod of my friend

this my friends locale
https://drive.google.com/open?id=10CLFQ ... g0LReurqXP

this is my locale
https://drive.google.com/open?id=1TsGij ... Wzc5ZxEKtM


EDIT:
Where do the game took his locale Information? from which lua file it tooks his translation word?

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

It is very strange, now i deleted my friends mod and loaded up my mod this this locale i try to fix for hours, now it works with locale. i dont understand. my friend looked into my mod himself and coulnt find something strange. could it be, that factorio has something like a cache that must be deleted? it is really strange

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

My problem still exists, can anyone help me? i make a short explain about whats wrong.

i have problems translating a word in my own translate.cfg

The first photo shows a cut out of the data.raw at wiki.factorio, there you can see the two data's "electric-energy-distribution-1" and "electric-energy-distribution-2" in the "Technology" category
https://drive.google.com/open?id=1UrtxT ... EKXod6lGeg

in the second photo you see a cut out of the original locale file in the base/locale/de/base.cfg. And here you can see uses the game just the word "electric-energy-distribution" without a Number.
https://drive.google.com/open?id=1xriKW ... vL_ml5HHfM

Why is that so?

i have added my locale file and my technology.lua. Why i cant force the game to use my "Technology" translations?
https://drive.google.com/open?id=1eZ-j7 ... l8SDKF5J97 for locale
https://drive.google.com/open?id=1OWaJW ... 1Fi0P01UAd technology

If i use the key electric-energy-distribution=any Word here then it Works but if i want to use electric-energy-distribution-1-1 like in my technology.lua

Any ideas?

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: How changing orginal Locale?

Post by Bilka »

Palaber1984 wrote:
Sat Sep 14, 2019 12:54 pm
The first photo shows a cut out of the data.raw at wiki.factorio, there you can see the two data's "electric-energy-distribution-1" and "electric-energy-distribution-2" in the "Technology" category
https://drive.google.com/open?id=1UrtxT ... EKXod6lGeg

in the second photo you see a cut out of the original locale file in the base/locale/de/base.cfg. And here you can see uses the game just the word "electric-energy-distribution" without a Number.
https://drive.google.com/open?id=1xriKW ... vL_ml5HHfM

Why is that so?
https://wiki.factorio.com/Prototype/Technology#name wrote:If the name ends with -number, the number is ignored for localization purposes. E. g. if the name is whatever-name-3, the game looks for the technology-name.whatever-name localization.
You can set the localized name of the technology to the locale key you want to use, like the base game does it for accumulators:

Code: Select all

    name = "electric-energy-accumulators",
    icon_size = 128,
    icon = "__base__/graphics/technology/electric-energy-acumulators.png",
    localised_name = {"technology-name.electric-energy-accumulators-1"},

Code: Select all

electric-energy-accumulators-1=Electric energy accumulators
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

You can set the localized name of the technology to the locale key you want to use, like the base game does it for accumulators:

Code: Select all

    name = "electric-energy-accumulators",
    icon_size = 128,
    icon = "__base__/graphics/technology/electric-energy-acumulators.png",
    localised_name = {"technology-name.electric-energy-accumulators-1"},

Code: Select all

electric-energy-accumulators-1=Electric energy accumulators
that means, i just have to add localised_name = {"technology-name.electric-energy-accumulators-1-1"} to all my technologies? if that is so then i am understanding it now. i will try it later

User avatar
Palaber1984
Inserter
Inserter
Posts: 32
Joined: Sat Feb 16, 2019 10:09 am
Contact:

Re: How changing orginal Locale?

Post by Palaber1984 »

ok thx bilka. it works now, it is sad, that no one before could give me this answer. if you want you can close this subject.

but by the way, can you give me a tip how reduce the code of an entity? actually i just copied the full entity of the games entity.lua, but i just changed 3-4 things. i want it to become less big for better filesize

Post Reply

Return to “Modding help”