Details
-
User Story
-
Resolution: Done
-
P2: Important
-
5.14.0
-
None
-
-
21
-
Qt6_Foundation_ Sprint 3, Qt6_Foundation_ Sprint 4, Qt6_Foundation_ Sprint 5, Qt6_Foundation_ Sprint 6
Description
The scripts in util/locale_database/ could be significantly improved:
- When something goes wrong, I can't import the script as a module and investigate what's going wrong in an interactive python session: importing the script runs it. It should define suitable classes and functions, then use an if _name_ == '_main_' block at the end to actually run the script.
- cldr2qlocalexml.py prints its output (i.e. writes it to sys.stdout), rather than taking the name of a file to which to write the output. Given that it also grumbles extensively on sys.stderr, this only makes sense if one is redirecting stdout to a file; and I've had to kludge the script to ensure sys.stdout.encoding is UTF-8, since it's apt to be None and mean ASCII, to which some of our data can't be encoded. So it would be better to write to a file named on the command-line (we can continue the time-honoured tradition of letting - as output-file mean write to stdout, and/or continue writing to stdout if no output file is specified) instead of printing.
- Everything needs to be fed to six and converted to python3, as it's currently all python2; it might also be constructive to add mypy type annotations to it.
Attachments
Issue Links
- is replaced by
-
QTBUG-83488 Convert python2 scripts to python3
- Closed
- is required for
-
QTBUG-81051 Add support for locale variants, e.g. @Catalan
- Open
-
QTBUG-81050 Do number-formatting correctly
- Closed
- relates to
-
QTBUG-82831 Do byte-amount formatting less wrongly
- Reported
-
QTBUG-79902 QLocale: make fuller and more faithful use of the CLDR data
- Open