* fix: remove translations from GL report options
Options need not be translated, their display label gets translated
client side.
* fix: make group by options translatable
* ci: semgrep rule for translated options in report
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit fa819f2fb0)
This commit is contained in:
13
.github/helper/semgrep_rules/report.yml
vendored
13
.github/helper/semgrep_rules/report.yml
vendored
@@ -19,3 +19,16 @@ rules:
|
||||
languages: [python]
|
||||
severity: ERROR
|
||||
|
||||
- id: frappe-translated-values-in-business-logic
|
||||
paths:
|
||||
include:
|
||||
- "**/report"
|
||||
patterns:
|
||||
- pattern-inside: |
|
||||
{..., filters: [...], ...}
|
||||
- pattern: |
|
||||
{..., options: [..., __("..."), ...], ...}
|
||||
message: |
|
||||
Using translated values in options field will require you to translate the values while comparing in business logic. Instead of passing translated labels provide objects that contain both label and value. e.g. { label: __("Option value"), value: "Option value"}
|
||||
languages: [javascript]
|
||||
severity: ERROR
|
||||
|
||||
Reference in New Issue
Block a user