Item name want in arabic automatically when enter item name

Hi Friends,
we have “Item name”, but it should automatically translate and appear in Arabic in the new field called “Item in Arabic”

Hi @sathya_raj,

The automatic translation feature is not yet but you should create and set the Arabic word in Translation doctype.

Then apply the client script for it.

frappe.ui.form.on('Item', {
    item_name: function(frm) {
        frappe.db.get_value("Translation", {"source_text": frm.doc.item_name, "language": "ar"}, "translated_text", function(value) {
            frm.set_value("item_in_arabic", value.translated_text);
        });
    },
});

If Item Name and Translation source text match then will set the Arabic value set in the item_in_arabic field.

Output:

I hope this helps.

Thank You!

1 Like