Set path for locale file

Discuss translation contributions here.
Hoochie
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Jan 01, 2025 5:11 am
Contact:

Set path for locale file

Post by Hoochie »

Hello!
Maybe someone can tell me, because I haven't found any information.
Is it possible to specify a different path to the locale file?
For example, there is a mod, it has 3 locale files with different languages, let's say EN, DE, IT, I have another file for the IT locale, and is it possible to specify that the translation should initially be taken from my folder with the file for IT?
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Set path for locale file

Post by IsaacOscar »

Hoochie wrote: Wed Jan 01, 2025 5:18 am Hello!
Maybe someone can tell me, because I haven't found any information.
Is it possible to specify a different path to the locale file?
For example, there is a mod, it has 3 locale files with different languages, let's say EN, DE, IT, I have another file for the IT locale, and is it possible to specify that the translation should initially be taken from my folder with the file for IT?
Im quite confused, but locale files must be in <mod-folder>/locale/<language-code>/<any name>.cfg.

If you want two it files in one mod, then <mod>/locale/it/file1.cfg and <mod>/locale/it/file2.cfg

If you're trying to modify thr locale of another mod, put your changes in <a-new-mod>/locale/it/file.cfg
Hoochie
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Jan 01, 2025 5:11 am
Contact:

Re: Set path for locale file

Post by Hoochie »

IsaacOscar wrote: Wed Jan 01, 2025 5:57 am If you're trying to modify thr locale of another mod, put your changes in <a-new-mod>/locale/it/file.cfg
Yes, I'm trying to change the locale of another mod, that is, I'm translating the mod, and I have a separate folder for locale files.
It happens that the translation in the mod is not quite accurate, and at the moment I have to replace the locale file, which is inconvenient, especially when updating the mod, my locale file no longer works, because it is deleted along with the old version of the mod.

I suppose that there is a way to tell the game from which folder to take the locale file for translation, that is, not from the standard mod folder (<mod-folder>/locale/<language-code>/<any name>.cfg), but from my disk on the PC - for example, C:/language/translate/<mod-name>/locale/<language-code>/<any name>.cfg.

The option to make a mod and put a locale file for another mod in there doesn't work, because if a mod has a locale file, it is used first and is not overwritten by another locale file. Or I did something wrong. :)
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Set path for locale file

Post by IsaacOscar »

Hoochie wrote: Wed Jan 01, 2025 1:31 pm The option to make a mod and put a locale file for another mod in there doesn't work, because if a mod has a locale file, it is used first and is not overwritten by another locale file. Or I did something wrong. :)
Really?
Is your now mod depending on the original mod?
Also, I think some keys might be mod specific?
But I've certainly done this before to modify the locale of the base game (which is just a 'mod' from Factorio's perspective).
Hoochie
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Jan 01, 2025 5:11 am
Contact:

Re: Set path for locale file

Post by Hoochie »

IsaacOscar wrote: Wed Jan 01, 2025 1:51 pm Is your now mod depending on the original mod?
Then I definitely did something wrong.
In dependencies I need to specify the original mod, then the translation will first be pulled from my file?
User avatar
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 843
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Set path for locale file

Post by IsaacOscar »

Hoochie wrote: Wed Jan 01, 2025 2:36 pm
IsaacOscar wrote: Wed Jan 01, 2025 1:51 pm Is your now mod depending on the original mod?
Then I definitely did something wrong.
In dependencies I need to specify the original mod, then the translation will first be pulled from my file?
Yup!
How the locale files are read depends on the load order of the mods. Using a dependency ensures that the mod loads after any dependent mods.
(The Wube mods, base, elevated-rails, quality, space-age) however will always load first.

(You can also make it an 'optional' dependency if you want people to use your new mod even if they don't have the old one).
Hoochie
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Jan 01, 2025 5:11 am
Contact:

Re: Set path for locale file

Post by Hoochie »

Thanks for the lesson, sensei!
I'll go try this method :)
Post Reply

Return to “Translations”