Skip to content

Refactor check spelling script #1108

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

Open
wants to merge 2 commits into
base: 3.14
Choose a base branch
from

Conversation

Maxcode123
Copy link

Τι αλλαγές εισάγει το παρόν PR;

  • Διαμοιράζει την λογική στο script check_spelling.py σε πολλαπλές συναρτήσεις
  • Προσθέτει τρεις επιλογές που μπορούν δοθούν μέσω γραμμής εντολής
  • Αλλάζει την προκαθορισμένη συμπεριφορά του προγραμμάτος (δεν τυπώνονται τα ευρεθέντα σφάλματα). Η προηγούμενη συμπεριφορά αναπαράγεται με την επιλογή -p ή --print-errors: python scripts/check_spelling.py --print-errors
  • Προσαρμόζει το Makefile target spellcheck ώστε να χρησιμοποιεί την παραπάνω επιλογή.

Γιατί χρειάζεται αυτό το PR;

Στον οδηγό συνεισφοράς αναφέρεται το εξής:

Εάν κάποια από τις λέξεις δεν είναι αναγνωρισμένη από το script προσθέστε τη στο dictionary και επαναλάβετε.

Υποβαλλόμενος στην διαδικασία της μετάφρασης του αρχείου library/trace.po έφτασα στο βήμα που περιγράφεται παραπάνω και επειδή βαριόμουν να προσθέσω τις λέξεις μία-μία αποφάσισα να ενισχύσω το υπάρχον script ώστε να αναλάβει αυτό τη δουλειά.
Η προσθήκη νέων λέξεων στο dictionary μπορεί να αυτοματοποιηθεί χρήσει του script:

> python scripts/check_spelling.py --write-entries

Σημειώσεις

Οδηγίες χρήσης script:

> python scripts/check_spelling.py --help
usage: python check_spelling.py [options]

spell-check translated .po files and add new entries to the dictionary if needed.

options:
  -h, --help            show this help message and exit
  -p, --print-errors    print the detected errors of the spell-check
  -w, --write-entries   write the new detected entries in the dictionary file
  -f, --po-files [PO_FILES ...]
                        list of .po files to spell-check, if not given checks all po files

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.

1 participant