- Home /
How should I structure my localization string tables?
I'm about to add localization to my game! This is the first time I've ever done localization, and I'm trying to figure out how to structure my string tables.
I have a Weapon ScriptableObject with hundreds of instances (Club, Pickaxe, Scimitar, etc.) and multiple localized fields (name, description, etc.). There are two options that make sense to me:
A single "Weapons" string table with multiple entries per weapon. This would look like:
* Weapons_en.asset
* CLUB.name = "Club"
* CLUB.description = "A thick, solid lump of wood."
* PICKAXE.name = "Pickaxe"
* PICKAXE.description = "Tool of sturdy miners."
One string table per field. This would look like:
* WeaponNames_en.asset
* CLUB = "Club"
* PICKAXE= "Pickaxe"
* WeaponDescriptions_en.asset
* CLUB = "A thick, solid lump of wood."
* PICKAXE = "Tool of sturdy miners."
The single "Weapons" string table structure will result in fewer files (especially since I have a few other ScriptableObjects like Weapon), but each file will be messier. The per-field string table will result in more files, but each file will be cleaner and the structure feels more "atomic" which appeals to my programmer brain.
Which structure would you pick? Or is there a better way of doing this that I'm missing?
It's only a matter where you want to put that mess :) No getting around it!
To me, your approaches both look good.
CLUB.name and CLUB.description looks very clear to me.
I would perhaps prefer this approach, since I assume "when you are changing information about a weapon, you would want to do it in one place (and in one file)".
I use CSV files. I have google spreadsheet where I put stuff, translate stuff, and then export as CSV. Then I have another script that turns that CSV into something useful. Your assets look nicer than my stuff. :)
Edit: I do not have much experience about doing localization properly in Unity. I know there are some assets and systems for handling all that, but I would not trust my opinion :) It's just an opinion.
Your answer
Follow this Question
Related Questions
Unity localization don't build for android 1 Answer
Language/translation connector to Unity - will it be useful? 0 Answers
What is best practice for translation handling? 0 Answers
How do I localize strings in the editor? 2 Answers
Synchronize damage dealing and block in melee combat multiplayer game 2 Answers