Hi everyone,
I’m working on a project and trying to set up a good system for localization and managing all my game’s UI text. My goal is to avoid hard-coding text in my events so that it’s easy to manage and, in the future, easy to hand off to a translator.
I’ve spent a lot of time trying a few different methods based on tutorials and examples, but I’ve run into a roadblock with each one and I’m getting a bit lost. I’m hoping the community can point me toward the current “best practice” for this.
Here is what I have tried so far:
Method 1: The Yarn/Ink Dialogue Tree Extension
-
Setup: I created a strings.yarn.txt file with simple key: value pairs (e.g., crafting_title: UPGRADE STATION).
-
Action: At the beginning of my scene, I use the Load dialogue tree from a JSON file action to load the file.
-
Expressions Tried: I’ve tried to get the text using DialogueTree::VariableString(“key”), InkDialogTree::StoryVariableText(“key”), and other variations.
-
Result: No matter which expression I use, the text objects on my screen remain empty. I have confirmed that the “Load” action is running before I try to get the text.
Method 2: Loading a CSV File
-
Setup: I created a localization.csv file with columns for key and en.
-
Action: I used the Load a scene variable from a JSON file action to load the .csv file into a scene structure variable called AllText.
-
Expression Tried: I tried to access the data using AllText[0].en.
-
Result: This also resulted in empty text objects, so it seems this action doesn’t parse CSVs as I expected, or I am doing it wrong.
My Question:
So I feel a bit stuck. For a medium-to-large project in the current version of GDevelop, what is the community’s recommended way to handle this?
-
Am I missing a simple step in the Yarn or CSV methods that’s causing them to fail?
-
Is the Global Variable Structure method really the most stable way, even if it gets very large?
-
I also just thought of making something like if Global Variable is EN change text to “english” and like that for each language but it also seems like a lot of work.
-
Is there another extension or a built-in feature I’m overlooking?
Any advice or a link to a working example would be hugely appreciated. I’m feeling a bit stressed and turned around on this, and I want to make sure I’m building on a good foundation.
Thanks in advance!