Open
Conversation
b8dbdb6 to
2d72482
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Ruby script that rewrites Crowdin-downloaded locale YAML files using Psych so that subsequent auto-merges don’t introduce irrelevant YAML style diffs.
Changes:
- Add
script/i18n/rewrite_crowdin_yml_filesto normalize YAML output viaYAML.safe_load+YAML.dump - Preserve leading header comments from each YAML file before rewriting
- Print a summary count of rewritten files
2d72482 to
4d4a71b
Compare
myabc
reviewed
Mar 27, 2026
|
|
||
| rewritten_count = crowdin_yml_files.count do |path| | ||
| content = File.read(path) | ||
| comments = content.lines.take_while { it.start_with?("#") } |
Contributor
There was a problem hiding this comment.
@toy stupid question perhaps, but do we actually need to preserve these comments?
Contributor
Author
There was a problem hiding this comment.
Preserving them was the simplest option, alternative is either to inject COPYRIGHT_short content or remove comments. Currently comments in files from crowdin are a squished version of whatever is in relevant en file, so empty, # English strings go here or similar, or the copyright
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Script to rewrite YAMLs downloaded using crowdin/github-action using ruby library, so that the auto merging script #22249 will not cause irrelevant style changes when auto resolving conflicts.
The script needs to first be present in dev and latest release branches to be able to use it from crowdin workflow changed in #22519.