I’m having trouble implementing a centralized localization workflow for my project, so I was hoping someone here could provide a solution.
Here is the workflow I am trying to implement:
- All in-game text is centralized in a single excel sheet, with each row containing a key as well as the text of all supported languages (if the number of entries gets too large, it can be split up into multiple excel sheets by category as appropriate).
- I plan to run a script that exports the excel into multiple csv files, one for each language, with each row containing the Key/SourceString pairs for that specific language, taken from the main excel.
- Each csv file would be imported as a StringTable asset for that language. UI text would be linked to the StringTable’s keys, and the text should dynamically update in the editor when changing the preview language.
I determined that this workflow should be the simplest, fastest, and least error-prone method of managing the text for my project, especially based on my experience using (not implementing) similar workflows on previous projects. I do not intend to use the Localization Dashboard to handle localization.
However, when testing this workflow, I hit a roadblock:
-
As an experiment, I created a simple file titled GameText.csv containing a couple Key/SourceString pairs in English (default language). I made another GameText.csv file with the same Key/SourceString pairs, but this time with the SourceString entries in Japanese.
-
I created a StringTable uasset file named GameText in the Content/Localization folder and imported the English GameText.csv file.
-
Right-clicking on the GameText.uasset StringTable file, I noticed that there was no “Asset Localization->Create Localized Asset” option. With this option unavailable, I tried creating localized versions of the GameText StringTable uasset by creating the folders Content/L10N/en/Localization and Content/L10N/ja/Localization and creating the corresponding GameText.uasset StringTable files inside these folders.
-
However, when opening a UMG widget to set one of the keys I prepared to a TextBox, three different GameText StringTables show up in the dropdown menu instead of one. Clearly, the Engine is recognizing Content/Localization/GameText.uasset , Content/L10N/en/Localization/GameText.uasset , and Content/L10N/ja/Localization/GameText.uasset as three completely separate StringTables instead of as multiple localized versions of the same asset.
Does anyone know if there is a way around this issue? It seems as though my workflow should be feasible if I can find a way for the different StringTables to be recognized as different-language versions of the same file instead of as completely different files. Thank you.
Edit: Alternatively, it might be easier to just use a single DataTable containing all text for all languages and implement a custom TextBlock widget that uses the custom table…? I might try this and see if I can get the binding to work properly so I can preview it in the UMG editor.
Edit 2: Adding a custom widget inherited from UTextBlock that updates the Text variable with data from my all-language DataTable according to UKismetInternationalizationLibrary::GetCurrentCulture() seems as though it might have solved my problem. Currently I’m performing the Text update on RebuildWidget() and PostEditChangeProperty(), and it works in the UMG editor as well. Additionally, you can change the culture in-game and update the text language without having to restart the game. On the other hand, might there be any unforeseen issues I’ll have to face later from using this custom approach instead of the built-in system…?