Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSV breaking when new rows get added. #1863

Merged

Conversation

CakeVR
Copy link
Collaborator

@CakeVR CakeVR commented Nov 2, 2023

Summary

This PR fixes two bugs when updating CSV using the Translation feature.

  • Adding a new translatable event breaks CSV file, if there are more than 2 locale keys.
  • Updating the CSVs closed the currently opened timeline.

Bug Cause

When a new line of text gets added to the CSV, eg. by adding a Text Event, it did not add trailing commas for each available locale.
Additionally, updating CSVs closed the current timeline node, but did not re-open it.

Bug Fix

We count the number of locale entries and count each entry per CSV row.
For every missing entry, we add trailing commas.

We also save the resource at the beginning of the method and once finished, silently open it again.

Additional Information

Changes comments and their positioning, adds a newlines were it helps readability.
In the future, this code section will require a full refactoring, as the overall method is quite complex.

Open closed timeline again.
@CakeVR CakeVR changed the title Fix CVS breaking when new rows get added. Fix CSV breaking when new rows get added. Nov 2, 2023
@Jowan-Spooner Jowan-Spooner merged commit 4e82244 into dialogic-godot:main Nov 2, 2023
@CakeVR CakeVR deleted the fix-translation-new-text-event branch January 1, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants