diff --git a/frappe/printing/page/print/print.js b/frappe/printing/page/print/print.js
index 8d09a2c4df..45c19b5a4d 100644
--- a/frappe/printing/page/print/print.js
+++ b/frappe/printing/page/print/print.js
@@ -362,6 +362,10 @@ frappe.ui.form.PrintView = class {
this.lang_code = this.language_sel.val();
}
+ has_rtl(){
+ return ["ar", "he", "fa"].includes(this.lang_code);
+ }
+
get_language_options() {
return frappe.get_languages();
}
@@ -412,7 +416,7 @@ frappe.ui.form.PrintView = class {
`
);
- if (out.has_rtl){
+ if (this.has_rtl()){
this.$print_format_body.find('head').append(
``
);
diff --git a/frappe/www/printview.py b/frappe/www/printview.py
index faea0306dd..f80d9d6ef0 100644
--- a/frappe/www/printview.py
+++ b/frappe/www/printview.py
@@ -204,8 +204,7 @@ def get_html_and_style(doc, name=None, print_format=None, meta=None,
return {
"html": html,
- "style": get_print_style(style=style, print_format=print_format),
- "has_rtl": True if frappe.local.lang in ["ar", "he", "fa"] else False
+ "style": get_print_style(style=style, print_format=print_format)
}
@frappe.whitelist()