Localized CSV string tables

Hello, I’m trying to use string tables dynamic loaded from CSV files in my project. (Currently, I am using “regular” texts in the game, and I run some scriptlets to generate .po files that the localization team can work with, but I want to stop using these and use only the .csv files.)

However, even with the documentation saying “String Tables provide a way to centralize your localized text into one (or several) known locations, and then reference the entries within a string table from other assets or code in a robust way that allows for easy re-use of localized text.”, it basically stops there, and how to actually implement localized texts using string tables seems necessary to do additional research on Google or ask in the answer hub, like I am doing now. Which is very frustrating…

Anyway, I already able to do some things, like:

  • The CSV files are already being loaded with the game module (I am calling the LOCTABLE_FROMFILE_GAME macro in my StartupModule function)
  • I am able to use the strings in Blueprints

However, to support multiple languages, I have no idea what I should do. I mean, if I copy the .csv files, translate the strings of each row to another language, what should I do with the file now? Should I run some scriptlet? Should I put the new .csv files in a specific folder? Should I configure something? Should I manually load the .csv files for the language I want?

I’m using UE 4.22.

(Also, the docs say “CSV string tables aren’t staged automatically. It is recommended that you place your CSV string tables in a known folder and then add them to the Additional Non-Asset Directories to Package in your project’s Packaging settings.”, which didn’t work for me. However, I was able to make the string table load in the package build by adding the folder into the Additional Non-Asset Directories to COPY.)

2 Likes

Couldn’t you have a column in your CSV for each language? Whereby each row is the same information and you fetch the right column based on whichever language.

Hi ConradG, I understand what you are saying, but I’m not using a custom system, I’m trying to use the built-in system of string tables, which doesn’t allow me to fetch the column I want. It is an automatic system and the table contains one column for the key and another one for the string itself.

My understanding is that they each get their own directory.



/Localisation/MyGame/en/<English>
/Localisation/MyGame/de/<German>
/Localisation/MyGame/fr/<Frennch>


etc.

But does this actually work? Should be exactly these directories, relative to the Content folder?

I tried to put the localized .csv files inside Content/L10N/de/Texts/Game.csv (because my main .csv file is in Content/Texts/Game.csv and this is the structure of the path for the localized assets, like textures). Didn’t work.

I also tried to call again the LOCTABLE_FROMFILE_GAME (C++) with a new path when the language of the game changes. First it throws an error because the stringtable already exists. So, I tried to call UnregisterStringTable before it. The error stopped, but it didn’t cause any effect and the texts didn’t update with new content.

It’s very frustrating not only because I don’t know how to do it, but also I don’t even know if I can do it. It would be so simple if the documentation only had a small text saying something like “You can load string tables from CSV files, however, you can’t localize it to multiple languages” or “You can load string tables from CSV files, and in case you want to have support for multiple languages, you should do this and that”.

Guessing it won’t work until you run the editor localisation tool to gather all the text.
Yet to do that ourselves, so again, unsure.

I know you mentioned not wanting a custom solution, but if your after one, its fairly easy to manually import the .csv at runtime yourself.
We recently updated our game to use Lua based scripts for game logic.
To make it ease for text to appear on the client and support localisation, this is what we did.

I think you are right. I was expecting something different, but yeah, this actually makes sense. Instead of translate the content of the string table, the localization tool will actually get the texts from the FTexts being used in the project, similar to when we are not using string tables. I know this localization workflow may have some advantages (like keep tracking for changes or updates), but I was expecting to be able to only work with .csv files, one for each language.

And again, it would be very helpful if the documentation was more explicit about how it work.

Hello there! I had the EXACT same questions, i.e. it feels like it’s the way to do it, but there is NO documentation on any of this.

I mean, perhaps it IS “the game needs to figure out the language and manually load the correct CSV”, which would be a bit annoying, but pretty manageable.

But the documentation doesn’t even talk about this.

So what is the recommended use of CSV for localization?