Can't translate Department, Leave Type, Employment Types etc

Translating departments, leave types, employment types etc are just not working. I have so far gone the lengths of enabling developer mode to make “Translatable” in every field that I’d like, uploaded a .csv file with translations etc but nothing so far is working. I’m on 12.1.5.

Can you guys please pay attention to this issue on the next release?

Thank you guys.

While at it, I’d like to add that Node.js labels need some translation capabilities as well. Specially when building “reports”. Small things like “Remove column” can’t be translated…

Please frame the problem context with say a specific case or two and attach screenshots to illustrate -

The aim here is to divide and conquer - to identify, isolate and contrast cases(s) of what is working with what is not.

Thank you clarkej, I’ve attached a couple of screenshots :slight_smile:

03%20AM

Specifically Sort descending, reset sorting, remove column etc can’t be translated. Only the Add Column :slight_smile:

Then, when you create a department for example, Mill Shop, I’d like to have it shown in dual languages. I do check the box “Translatable” for the field in both customize form as well as the DocType. But it just doesn’t happen. I do clear-cache, do restart the bench etc… Even did a bench build.

Please do care for these on the next release :smiley: My specifics DocTypes that are not being translated are: leave types, departments, employment types, branches :slight_smile:

Thank you sir, and thank you ERPNext!

Thank you! This error and fix request you best document for consideration here Issues · frappe/erpnext · GitHub

Please link to that issue record here in this thread, so all concerned can refer upvote and add their findings.

More screenshots - say full page views of each affected page - might help inform to resolve this issue.

One question is whether this is language independent or not - does a similar error occur in other languages? Whatever you can offer or find to identify that, would help too.

edit: One more suggestion: Periodically search and review the issue reports for similar related cases, so you can group together to promote your case.

Thank you ClarkeJ. Honestly, I really don’t have the time and I really hope someone too will realize these and resolve them in the near future. I would really like to help by going around every bit of the system and see which are being translated and what not, but I’m only working on the HR module of ERPNext for a client, and I better dedicate my time for the paying client at this moment.

BTW, I’ve tried all the other languages, and the issue persisted.

Thank you, I’m sure now at least a few people are paying attention to this :slight_smile:

Yes to help move the ball ahead is what counts!

As for this popup menu problem you refer to -

All but Add Column are hard coded on the client here ./apps/frappe/node_modules/frappe-datatable/src/defaults.js

Hence to find the code for Add Column, that translates that as expected (say somewhere on the server?), is key to resolving that part of the puzzle…

EDIT: To footnote re this below with the notes above

A grep search for ‘Remove Column’ and ‘Remove column’ turned up no server side code, unlike this 'Add Column search below that does - that seems to confirm your translation case observations

frappe@ubuntu:~/frappe-bench$ find . -name '*.js' | xargs grep 'Add Column'
./apps/frappe/frappe/public/js/frappe/views/reports/query_report.js:    
                        label: __('Add Column'),
./apps/frappe/frappe/public/js/frappe/views/reports/query_report.js:    
                                        title: __('Add Column'),
./apps/frappe/frappe/public/js/frappe/views/reports/reportview.js:      
                <div><button class="btn btn-default btn-sm btn-add">'+__("Add Column")+'</button></div>');
./apps/frappe/frappe/public/js/frappe/views/reports/report_view.js:     
                        label: __('Add Column'),
./apps/frappe/frappe/public/js/frappe/views/reports/report_view.js:     
                                        title: __('Add Column'),

FWIW this post outlines the corresponding client and server method code that sends the js code from the server to the client.

Note that in the get_js method, this line apparently runs language translation (I think) before the server sends the js off to the browser client

Thank you. I’ve grep’d the files as well previously, but didn’t want to edit the files directly. That’s when I stopped and turned to the forum for help :stuck_out_tongue_winking_eye:

Hello @clarkej, I’ve finally got some time on my hand and have decided to track down what are not being translated as intended.

Here are some, so far. And I’ll keep the thread updated.

First, the usuals, “departments, employment types, designations, and branches”.

Then, when building a report in HR “Add Group” call all the filterable fields but only in English.

I’ll keep the thread updated, as I find more time and more of this untranslatable areas of the system :smiley:

Thank you Clarke, and thank you contributors who’s taking care of stuff!

create js file in public and add in hooks

app_include_js.append("/assets/{app_name}/js/reports.js")

$(document).ready(function() {
setTimeout(() => {
var elements =  document.getElementsByClassName("dt-dropdown__list-item");
for (var i = 0, l = elements.length; i < l; i++) {
  elements[i].innerHTML = elements[i].innerHTML.replace(elements[i].innerHTML, function (x) {
  return __(x);
});
}
 }, 2000);
});
1 Like

Nice trick. I wonder does it still applies? @mohamed_ouff

yes working