-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add initial support for ICU MessageFormat. #6582
Conversation
* Implements a fairly comprehensive checking class. * Adds documentation about the check to admin/checks.rst and user/checks.rst * Includes a new dependency on `pyicumessageformat`.
Codecov Report
@@ Coverage Diff @@
## main #6582 +/- ##
==========================================
- Coverage 91.41% 91.40% -0.01%
==========================================
Files 624 626 +2
Lines 47023 47405 +382
Branches 5204 5292 +88
==========================================
+ Hits 42984 43330 +346
- Misses 2737 2765 +28
- Partials 1302 1310 +8
|
Sorry, I completely forgot about PrismJS highlighting in the first commit as I was thinking about refactoring the Live Preview feature. Do you want me to restart this PR on a cleaner branch? |
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.
Thanks, looks good! It would be great if you could improve test coverage for the code.
) | ||
|
||
if result.get("tag_empty"): | ||
yield _("XML Tag missing contents in translation: %s") % ", ".join( |
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.
Can you please for more of the format_result branches?
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 to be sure I'm not missing something here, did you mean "Can you please test for more [...]"?
Given the earlier comment about increasing test coverage, that's my assumption but I want to be sure.
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.
Yes, that's it. Sorry for missing one word here....
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.
Avoid nesting if statements.
Merged, thanks for your contribution! |
Proposed changes
This pull request implements a new check for ICU MessageFormat messages. This check:
Specifically, this pull request:
weblate.checks.icu.ICUMessageFormatCheck
pyicumessageformat
which was written for this purpose.user/checks.rst
andadmin/checks.rst
This pull request does not:
Live Preview
that I have showed screenshots of in issue weblate & icu format #2856.Checklist
Other information
Screenshot of a syntax error: