Bug and Usability issues using the Unity Localization Third Party addon
-
- Posts: 14
- Joined: Fri Aug 04, 2023 11:20 am
Re: Bug and Usability issues using the Unity Localization Third Party addon
Hi there!
I just wanted to share that I had to add the following lines to DialogueToLocalizationTableWindow.cs in order to export any localizations we had already added manually through the Dialogue System fields.
This will export stuff like the Localization field "pt" in a Dialogue Entry.
Line 378 on DialogueToLocalizationTableWindow.cs:
I just wanted to share that I had to add the following lines to DialogueToLocalizationTableWindow.cs in order to export any localizations we had already added manually through the Dialogue System fields.
This will export stuff like the Localization field "pt" in a Dialogue Entry.
Line 378 on DialogueToLocalizationTableWindow.cs:
Code: Select all
// Add localized entries:
if (!string.IsNullOrEmpty(entry.DialogueText))
{
table.AddEntry(field.value, entry.DialogueText);
//! The following code is not supported by the creator and should be removed later
// Add localizations
foreach (var stringTable in stringTableCollection.StringTables)
{
var localizedField = Field.Lookup(entry.fields, stringTable.LocaleIdentifier.Code);
if (localizedField == null)
continue;
string localizedText = localizedField.value;
if (!string.IsNullOrEmpty(localizedText))
stringTable.AddEntry(field.value, localizedText);
}
}
Re: Bug and Usability issues using the Unity Localization Third Party addon
I'll add a task to the roadmap to add a checkbox to export localized fields to the Localization Package string table. I'll try to get it into the next update so you won't have to reapply your customization if you import an updated Localization Package Support package.
-
- Posts: 14
- Joined: Fri Aug 04, 2023 11:20 am
Re: Bug and Usability issues using the Unity Localization Third Party addon
Hi there!
something concerning that ended up causing a problem here, I decided to share it again.
The method "CopyDialogueDatabasesToStringTable()" on DialogueToLocalizationTableWindow.cs was lacking a EditorUtility.SetDirty(database) and a AssetDatabase.SaveAssets() in order for Git to detect the newly created Guid fields with prepended names.
So whenever I deleted the old Guids and created the new StringTable, my commit did not include the new Guid with conversation names, but after I added those commands I was able to commit the full changes.
Keep in mind that the other method, CopyStringTableToDialogueDatabases() does have the EditorUtility.SetDirty(database), but the one that copies the Dialogue to the StringTable and creates the Guids didn't seem to have.
Maybe I understood something wrong, but now it's working.
something concerning that ended up causing a problem here, I decided to share it again.
The method "CopyDialogueDatabasesToStringTable()" on DialogueToLocalizationTableWindow.cs was lacking a EditorUtility.SetDirty(database) and a AssetDatabase.SaveAssets() in order for Git to detect the newly created Guid fields with prepended names.
So whenever I deleted the old Guids and created the new StringTable, my commit did not include the new Guid with conversation names, but after I added those commands I was able to commit the full changes.
Keep in mind that the other method, CopyStringTableToDialogueDatabases() does have the EditorUtility.SetDirty(database), but the one that copies the Dialogue to the StringTable and creates the Guids didn't seem to have.
Maybe I understood something wrong, but now it's working.
Re: Bug and Usability issues using the Unity Localization Third Party addon
Thank you for reporting that. CopyDialogueDatabasesToStringTable() was only saving the string tables, not the dialogue database(s). This updated integration (which will be in 2.2.52) fixes that and also includes your code above. You can enable the code by ticking the new "Export Localized Fields" checkbox in the window.
DS_LocalizationPackageSupport_2025-03-25.unitypackage
DS_LocalizationPackageSupport_2025-03-25.unitypackage