Hi:
I tried GetLocalizedString without providing a table reference and it will not found translation for the key,
is this a bug or I am doing somthing wrong?
Thanks for helps!
You need to change the Default Table Reference in the localization settings. At the moment it’s looking for a table called DefaultStringTableCollection, change it to UI
Thanks, after I change the default to "UI"it works. But I tried to change the default table Reference to other string table in the same group, i.e. “Items” string table, and GetLocalizedString() cannot find the translation again.
Is there a way to configure the GetLocalizedString() to lookup all string tables in the same group?
I’m not sure I understand. You changed it to a different table and now it doesn’t work? Did you do this whilst in play mode?
What do you mean by same group?
There are multiple string tables under “DefaultStringTableCollection” group, i.e. string table “Items” and string table “UI” and string table “Buildings” (shown in screenshot above, they are all under “DefaultStringTableCollection” group).
The problem is, If I set Default Table Collection Name as “UI”, by using “LocalizationSettings.StringDatabase.GetLocalizedString(“GameTitle”);”, I can get the entry of “GameTitle”, but if I set the Default Table Collection Name as “Items”, it would not find the entry of “GameTitle”.
The goal I want to achive is, I would call “LocalizationSettings.StringDatabase.GetLocalizedString({Key});”, without specifying a table name, I still can get the entry no matter which string table I set as default. i.e. even I set the Default Table Collection Name as “Items”, not “UI”, I can still get entry “GameTitle”.
The group is only used when showing the selection menu, so we can group them on the menu. We don’t do anything else with it.
The default table collection name can only be a single table collection, it’s cant be a group. If you don’t want to specify the table then I would put all the entries into a single table, otherwise it’s unavoidable and you will need to specify a table.