fix: General Ledger translation issues (#27298) (#27392)

* 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:
Frappe PR Bot
2021-09-08 16:41:41 +05:30
committed by GitHub
parent 67174ef1b3
commit 30e02f092d
3 changed files with 43 additions and 13 deletions

View File

@@ -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