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

Update localizations button #227

Merged

Conversation

stalhandske
Copy link

Added a "Update Localizations" button to the Yarn Importer Editor. It goes through each string table CSVs in localizations, compares it to the base string table, merges them based on a set of rules, and creates updated versions of the localizations in seperate files.

Specifics on the merge rules used can be found as comments in the code.

@desplesda desplesda changed the base branch from master to develop April 12, 2020 02:20
}
}

public struct CsvEntry
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this struct isn't used outside this file, can it be private?


mergedEntries.Sort((a, b) => a.lineNumber.CompareTo(b.lineNumber));

//foreach (CsvEntry e in mergedEntries)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this commented-out debugging code?

@@ -160,4 +173,229 @@ public class YarnImporterEditor : ScriptedImporterEditor {

AssetDatabase.ImportAsset(assetPath);
}

void UpdateLocalizations(string newBaseCsv)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation is really comprehensive in the second half of MergeStringTables, but there's a bit less in the first half and in UpdateLocalizations. Can you expand on the comments a bit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, new commit up with more comments and fixes

- comments
- removed debug code
- cleaned up the for-loop in UpdateLocalizations()
- fixed a place where it didn't add the "(((NEW LINE)))" to new lines
- made the struct private
@desplesda desplesda merged commit 52976f4 into YarnSpinnerTool:develop May 13, 2020
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.

2 participants