Skip to content
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

fix: pass labels through translation function #27252

Merged
merged 1 commit into from
Aug 31, 2021

Conversation

18alantom
Copy link
Member

Description

Some noob forgot to call _ on the labels in the Process Loss Report. Hence added them.

@ankush ankush merged commit 88aa7b8 into frappe:develop Aug 31, 2021
@ankush
Copy link
Member

ankush commented Aug 31, 2021

@18alantom can you take a stab at formulating semgrep rule for this? So all new reports / new fields will have translate calls.

You'll have to duplicate this rule to apply specifically on report labels.

- id: frappe-missing-translate-function-python
pattern-either:
- patterns:
- pattern: frappe.msgprint("...", ...)
- pattern-not: frappe.msgprint(_("..."), ...)
- patterns:
- pattern: frappe.throw("...", ...)
- pattern-not: frappe.throw(_("..."), ...)
message: |
All user facing text must be wrapped in translate function. Please refer to translation documentation. https://frappeframework.com/docs/user/en/guides/basics/translations
languages: [python]
severity: ERROR

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 51.638% when pulling 4c21a32 on 18alantom:fix-plreport-labels into 88d8493 on frappe:develop.

asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
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.

None yet

3 participants