-
Notifications
You must be signed in to change notification settings - Fork 479
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
Remove out.sh script #22727
Remove out.sh script #22727
Conversation
Diff with whitespace changes ignored: https://github.com/code-dot-org/code-dot-org/pull/22727/files?w=1 |
Are you looking for feedback on the code moved to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some feedback on code I know you're just moving from one place to another, feel free to ignore if you don't think it's worth cleaning up at this time.
@@ -31,6 +34,80 @@ def rename_from_crowdin_name_to_locale | |||
end | |||
end | |||
|
|||
# Distribute downloaded translations from i18n/locales | |||
# back to blockly, apps, pegasus, and dashboard. | |||
def distribute_translations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to split up this huge method.
The Dashboard, Apps, Blockly Core, and Pegasus steps have similar structure — can we extract a common helper method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking over this closer, it feels like the main thing these all share in common is the special-casing for Armenian, which I'm pretty sure I'm gonna be able to remove (in a separate PR).
I vote we leave this as-is for now, and when I figure out whether or not I can stop special-casing Armenian I'll improve this then
bin/i18n/sync-codeorg-out.rb
Outdated
end | ||
end | ||
|
||
puts "Distribution finished! " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces in this print line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a lazy way to overwrite the previous line
bin/i18n/sync-codeorg-out.rb
Outdated
end | ||
|
||
### Apps | ||
js_locale = locale.tr('-', '_').downcase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to do a one-time rename so we don't need to think about this special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like actually move the files? That would probably be a decently large work item
if file_type == "yml" | ||
new_translation = YAML.load_file(new_translation_path) | ||
# Translation begins | ||
if file_type == "yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: prefer single quotes for strings without interpolation.
PTAL! |
Verified that we no longer need to special-case Armenian and removed the relevant code |
This one will probably be easiest to review commit-by-commit.
Overall, it moves most of the functionality of the out.sh script into the out.rb script, rather than calling the former from the latter.
The one major change it makes to the out.sh script is to no longer call the
fix-ruby-yml.pl
script, which I have confirmed we don't actually need for the "out" sync.Next steps (in future PRs):
fix-ruby-yml.pl
forsync-pegasus.sh
andin.sh
, either, and remove it entirely.codeorg-messages.sh
functionality in here, too, so we can also remove that dependency