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: add missing translation function on report related documents #32713

Merged
merged 10 commits into from
Nov 3, 2022
Merged

fix: add missing translation function on report related documents #32713

merged 10 commits into from
Nov 3, 2022

Conversation

ernestoruiz89
Copy link
Contributor

Please provide enough information so that others can review your pull request:

Explain the details for making this change. What existing problem does the pull request solve?

Screenshots/GIFs

@@ -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),
Copy link
Contributor Author

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))
Copy link
Contributor Author

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),
]
Copy link
Contributor Author

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
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #32713 (4c7fa94) into develop (183662c) will decrease coverage by 0.00%.
The diff coverage is 42.85%.

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     
Impacted Files Coverage Δ
.../report/accounts_receivable/accounts_receivable.py 71.11% <ø> (ø)
...t/budget_variance_report/budget_variance_report.py 0.00% <ø> (ø)
...evenue_and_expense/deferred_revenue_and_expense.py 61.30% <ø> (ø)
.../selling/report/sales_analytics/sales_analytics.py 67.61% <33.33%> (ø)
...xt/stock/report/stock_analytics/stock_analytics.py 93.91% <33.33%> (ø)
erpnext/stock/report/stock_ageing/stock_ageing.py 90.95% <100.00%> (ø)
erpnext/stock/doctype/serial_no/serial_no.py 88.96% <0.00%> (-0.24%) ⬇️

@@ -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"))) {
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is not translated it does not work, because the field is translated from python

image

@deepeshgarg007
Copy link
Member

@Mergifyio backport version-14-hotfix

@mergify
Copy link
Contributor

mergify bot commented Nov 3, 2022

backport version-14-hotfix

✅ Backports have been created

deepeshgarg007 added a commit that referenced this pull request Nov 3, 2022
…-32713

fix: add missing translation function on report related documents (backport #32713)
@ernestoruiz89 ernestoruiz89 deleted the patch-9 branch November 3, 2022 20:51
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants