in the right side is the designation doctype its data does not translate in the view list
this is the example of translate doc in the left side
but when open the doc the translate is worked
how to display the translate in the list view??
but when open the doc the translate is worked
how to display the translate in the list view??
Enable this on doctype
i was checked
any one solve this issue?
It seems that the problem lies in the List View JS file, where the code responsible for applying translations is executed in a limited manner. This happens because the translation logic is within a conditional block that is applied only if df.options
is explicitly listed in translated_doctypes
.
For example, I would like the Report DocType ID to be translated:
But hereās the code as it is:
By adding the __()
function to the value_display
variable, the strings were successfully translated.
However, I am not proficient in JS, and I believe this might not be the proper solution. Obviously there must be a reason to be the way as it is.
Does anyone know the best approach to handle this?
Maybe even via Client Script?
you edit in the core ?
are you sure from this
i suggest the solve is to edit the core code in frappe repo itself
no need to edit the core its working fine for me
which document u r using?
designation
in HR
Well, I was just testing locally because Iām running into the same issue with doctypes created by Frappe / ERPNext, like Report
and Country
.
Some of them are standard and donāt let you check the ātranslate link fieldsā option. I tried using the Property Setter (via custom app), but that didnāt work either. And even for the non-standard doctypes, checking the box didnāt solve the problem.
So, I tried to figure it out if the issue was in the code, and what I did solved my problem, but Iām not willing to change the core in a fork or suggesting code changes to frappe repo without being sure of what Iām doing. Like I said, Iām not proficient in JS or a front-end developer. Maybe there is some other way around, just trying to figure out and maybe get some help
as far as i know you can use jinja templeting for translations like if its static text use {{(āyour text hereā)}} and if dynamic use {{(your text here)}}
Nice, thanks! I havenāt tried Jinja yet, but Iām reading through the docs and will give it a shot. Iāll come back with feedback once Iāve tried it out.
In the end, I didnāt use Jinja. The following client script did the job:
frappe.listview_settings["Report"] = {
formatters: {
"name": function(value, doc) {
return __(value);
}
}
};