Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

🌐 Interactive Translation Manager #150

Merged
merged 13 commits into from Oct 24, 2021
Merged

Conversation

marciska
Copy link
Contributor

@marciska marciska commented Oct 10, 2021

Issues

Addresses issue #149

Changelog: 📝

  • Interactive translation manager: Can translate fast from the terminal to a target language in an interactive session. Exports the strings to the corresponding language JSON file.
  • More error checks: New InvalidLanguageError exception in case an invalid language has been requested for translation.
  • Better KeyboardInterrupt exception handling.
  • Added README to explain how to use the translation manager.

Check the following video for what the interactive translation manager does:
animation

TODO: ☑️

  • Provide option that only new keys (keys that do not yet exist or have a non-empty value in the target JSON) shall be prompted for translation (second task of [Feature] Interactive translation #149).

Other

Please add the hacktoberfest-accepted label to this pull request if it is accepted! 😃

@ann-kilzer
Copy link
Contributor

Thanks for your submission, looks interesting.

  • In general, it's better to ask before working on tickets that other people are working on (Python Script Improvements #51 ). Going forward, please ask in our Slack before changing the localization process
  • Most of our translators are non-technical and use GitHub to edit the files.

Let me take a closer look and see if it could fit into our process.

Copy link
Contributor

@ann-kilzer ann-kilzer left a comment

Choose a reason for hiding this comment

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

Okay, I tried it out tonight, and it's really cool. ✨ Thanks for creating this and I think it could definitely be useful in our process. I'd like to request a few changes before merging.

  1. For consistency, we want to always use English as the source language. (It's also the fallback language for the i18n in the main project) Could you please change the command to only accept a TARGET_LANGUAGE and always translate from English?

  2. It might be useful to have a mode that focuses on missing keys in the TARGET_LANGUAGE, as we have over 136 keys now.

Thanks again!

tools/README.md Outdated
@@ -0,0 +1,23 @@
# Translation Manager

For a faster translation process, consider using the interactive translation manager.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that many people who visit our repo are using GitHub for the first time, so this will only be faster for a percentage of users. It might be worth noting that this tool requires familiarity with the command line.

@marciska marciska changed the title Interactive Translation Manager 🌐 Interactive Translation Manager Oct 17, 2021
Copy link
Contributor Author

@marciska marciska left a comment

Choose a reason for hiding this comment

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

I finished all the points you mentioned 🎉
Translation_Manager

  • Default mode is now that only missing keys will be translated 🔑
  • The readme is updated to address the familiarity issue 👨‍👩‍👦
  • The "force recreate all keys" option is now accessible by passing the flag -recreate to the command 🎯

The recreate flag is useful if you want to proof-check keys since it shows you the English source sentence alongside the current translation. Translations that you consider good can be simply inherited when you leave the prompt empty.
This should be much faster than having 2 files open and comparing it with the English source.
I also used it for the other PR earlier to proof-check and fix the issues in the German localization 🤗

Last but not least, if this marks the PR as merge-ready, please add the hacktoberfest-accepted label to this PR! 🤗
(I noticed that the Hacktoberfest-label is on the main-repo of Find a Doc, but not on this repo... 🥲)
Hacktoberfest

See you on Slack for the next projects! 😇

🚸 import readline to support arrow keys on input()
Copy link
Contributor

@ann-kilzer ann-kilzer left a comment

Choose a reason for hiding this comment

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

It's really slick. I like that I can hit enter to keep the current translation, or write a change.

Very good work.

@ann-kilzer ann-kilzer merged commit deb6555 into ourjapanlife:main Oct 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants