Page 1 of 1

Shipping Localization string tables in mods

Posted: Wed Mar 24, 2021 9:13 pm
by Kab the Bird Ranger
For a mod, I need to make custom RSC format strings. As those can be difficult to reproduce in string literals inside the code, and for the sake of potential localization, I thought of putting those strings inside a localization string table. These tables can easily handle RSC strings, as seen in Internal_RSC.

The file I made (Backstories_RSC) was essentially like Internal_RSC. Using a custom TextProvider, when being requested a certain string id, I can make a lookup into my string table and see if it provides a string for that, and fallback to Internal_RSC if not.

This works fine when playing from the Editor. I do need to build addressables, but otherwise it's all good. But that limitation seems to be fatal for modding support.
Shipping a string table with your mod won't be enough for a DFU client to use the table. You can't ship addressables with your mod either, since it won't merge with other mods that would like to do the same.

Am I missing something in terms of how to load localization string tables in mods? Should mods rely on something else for RSC strings?

I noticed the string tables in StreamingAssets/Text, and I know mods can provide such a table. However, that does not seem appropriate for RSC strings.

Re: Shipping Localization string tables in mods

Posted: Thu Mar 25, 2021 9:59 pm
by Hazelnut
Kab the Bird Ranger wrote: Wed Mar 24, 2021 9:13 pm For a mod, I need to make custom RSC format strings. As those can be difficult to reproduce in string literals inside the code,
You can use tokens easily enough to replace RSC entries. See examples in Archeologists mod. Just wanted to point that out, though for localization that's not going to solve the problem. :)