-
Notifications
You must be signed in to change notification settings - Fork 3
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
Run tools::checkPoFile on translations as a custom check #8
Comments
Looking at the docs and source of Easiest might be to rewrite the R-related checks (it has not been updated for ~10 yrs and hopefully involves only a few lines to make sure that the same number of conversions are provided) in Python and include as a custom check. |
|
Actually, I did mention that last time the You may still run the checks periodically (once per week / month) if you'd want and have a public landing page to see the results of the last checks. |
As Martin points out, at a minimum we need to do this as part of the wrap-up process for submitting patches to R-core. OTOH, the fixes might sometimes require language-specific context that us translation maintainers lack to correct, so surfacing things directly to translators at translation-time would be preferable. The Arabic issues below are a good example. For some context, here are the issues that
|
@daroczig I don't quite understand where we'd put the .py file that implements the related checks, any idea? e.g. we can very easily port over the checks for "bad" percent signs: I've noticed the Arabic translations tend to use from django.utils.translation import gettext_lazy
from weblate.checks.base import TargetCheck
class ArabPercentCheck(TargetCheck):
check_id = "arabic-percent-check"
name = gettext_lazy("Arabic % check")
description = gettext_lazy("Use % instead of the Arabic ٪")
# Real check code
def check_single(self, source, target, unit):
return "٪" in target (and similar for the other two) As to the other checks |
I should have read your comment#3 again, sorry :) I've had a go at implementing this, here's ls -R
.:
custom_checks customize
./custom_checks:
check_po_files setup.py
./custom_checks/check_po_files:
__init__.py percent.py
./customize:
__init__.py models.py __pycache__
./customize/__pycache__:
__init__.cpython-310.pyc __init__.cpython-311.pyc models.cpython-310.pyc models.cpython-311.pyc
I'm still not sure how to make this get passed into the weblate docker (will it happen automatically?), and more importantly how to register it in
|
From Michael Lawrence:
We could implement a hook to do so before committing to weblate's DB: https://docs.weblate.org/en/latest/admin/checks.html#writing-own-checks
We will need to either trigger
tools::checkPoFile
from a python helper usingrpy2
or might need to set up an API insteadThe text was updated successfully, but these errors were encountered: