-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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: add missing translation function on report related documents #32713
Conversation
ernestoruiz89
commented
Oct 26, 2022
…ue_and_expense.py
… match the variance word translated
@@ -1009,7 +1009,7 @@ def setup_ageing_columns(self): | |||
"{range3}-{range4}".format( | |||
range3=cint(self.filters["range3"]) + 1, range4=self.filters["range4"] | |||
), | |||
"{range4}-{above}".format(range4=cint(self.filters["range4"]) + 1, above=_("Above")), | |||
_("{range4}-Above").format(range4=cint(self.filters["range4"]) + 1), |
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.
Doing this way are more control to translation, example in spanish i would translate this as "90 días a más" or "mayor a 90 días"
@@ -313,11 +313,11 @@ def get_periodic_data(self): | |||
|
|||
def get_period(self, posting_date): | |||
if self.filters.range == "Weekly": | |||
period = "Week " + str(posting_date.isocalendar()[1]) + " " + str(posting_date.year) | |||
period = _("Week {0} {1}").format(str(posting_date.isocalendar()[1]), str(posting_date.year)) |
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.
cleaner code
@@ -198,11 +198,11 @@ def setup_ageing_columns(filters: Filters, range_columns: List): | |||
f"0 - {filters['range1']}", | |||
f"{cint(filters['range1']) + 1} - {cint(filters['range2'])}", | |||
f"{cint(filters['range2']) + 1} - {cint(filters['range3'])}", | |||
f"{cint(filters['range3']) + 1} - {_('Above')}", | |||
_("{0} - Above").format(cint(filters['range3']) + 1), | |||
] |
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.
Doing this way are more control to translation, example in spanish i would translate this as "90 días a más" or "mayor a 90 días"
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #32713 +/- ##
===========================================
- Coverage 63.79% 63.79% -0.01%
===========================================
Files 817 817
Lines 58453 58453
===========================================
- Hits 37290 37289 -1
- Misses 21163 21164 +1
|
@@ -75,7 +75,7 @@ frappe.query_reports["Budget Variance Report"] = { | |||
"formatter": function (value, row, column, data, default_formatter) { | |||
value = default_formatter(value, row, column, data); | |||
|
|||
if (column.fieldname.includes('variance')) { | |||
if (column.fieldname.includes(__("variance"))) { |
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.
@ernestoruiz89 This is not a user-facing string. Its an internal field name, it should not be translated
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.
@Mergifyio backport version-14-hotfix |
✅ Backports have been created
|
…-32713 fix: add missing translation function on report related documents (backport #32713)