-
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
Changes from all commits
a963618
a671652
71a0ae2
c1e608d
083a781
48ed638
2012bdf
b7b53b5
9c529c6
4c7fa94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
if (data[column.fieldname] < 0) { | ||
value = "<span style='color:red'>" + value + "</span>"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,11 +313,13 @@ 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 commentThe reason will be displayed to describe this comment to others. Learn more. cleaner code |
||
elif self.filters.range == "Monthly": | ||
period = str(self.months[posting_date.month - 1]) + " " + str(posting_date.year) | ||
period = _(str(self.months[posting_date.month - 1])) + " " + str(posting_date.year) | ||
elif self.filters.range == "Quarterly": | ||
period = "Quarter " + str(((posting_date.month - 1) // 3) + 1) + " " + str(posting_date.year) | ||
period = _("Quarter {0} {1}").format( | ||
str(((posting_date.month - 1) // 3) + 1), str(posting_date.year) | ||
) | ||
else: | ||
year = get_fiscal_year(posting_date, company=self.filters.company) | ||
period = str(year[0]) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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" |
||
for i, label in enumerate(ranges): | ||
fieldname = "range" + str(i + 1) | ||
add_column(range_columns, label=f"Age ({label})", fieldname=fieldname) | ||
add_column(range_columns, label=_("Age ({0})").format(label), fieldname=fieldname) | ||
|
||
|
||
def add_column( | ||
|
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"