[Question] What is the best way to provide alternative localisations?

Place to get help with not working mods / modding interface.
Post Reply
JasonMiles
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Sep 21, 2017 9:28 am
Contact:

[Question] What is the best way to provide alternative localisations?

Post by JasonMiles »

Hi,
I'm the author of the ToDo List mod.
There is a request to enable a quest log mode to have everything more RPG like.

I'm now trying to understand how to implement this the best way.

1. provide a second mod with the changed translations
+ easy to toggle for players
- lot of overhead
- hard to keep in sync

2. provide second set of translations with different prefix (todo, todo_quest). Then generate the localisation strings based on a mod setting
+ easy to keep in sync
+ no additional mod to support
+ can be changed at runtime
- all translations have to be duplicated
- all translation strings need to be generated

3. Only provide changed translations, recognize at runtime which one should be used.
Ideally I could do a lookup as "does a translation for this key for this player exist?". Then I could decide on the fly if I want to use the quest localisation or the default. Or I keep a list of all changed keys in memory and generate translation strings based on that
Alternatively it would be really cool to provide multiple translations with a priority (this is not possible atm afaik).

+ only changed strings need to be added
+ easy to keep in sync, all in the same mod
+ can be changed at runtime
- all changed keys need to be maintained in a list

Is there a different option I'm missing?
What are your thoughts on how to do this?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [Question] What is the best way to provide alternative localisations?

Post by Klonan »


2. provide second set of translations with different prefix (todo, todo_quest). Then generate the localisation strings based on a mod setting
+ easy to keep in sync
+ no additional mod to support
+ can be changed at runtime
- all translations have to be duplicated
- all translation strings need to be generated
This option sounds mos reasonable,
Except:

- all translations have to be duplicated
Is not true, the setting can be not used for things it does not affect

- all translation strings need to be generated
What does this mean?

JasonMiles
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Sep 21, 2017 9:28 am
Contact:

Re: [Question] What is the best way to provide alternative localisations?

Post by JasonMiles »

It means for every translation that I want to have changeable I have to switch from `{"todo.some_thing"}` to `{todo.translate("some_thing")}`. Which is inconsistent.
So ideally I switch for everything..

But thanks for the input. I'll go this way then :)

Post Reply

Return to “Modding help”