difference frappe.require(".js") & {% include a.js%}, seems later option won't load translated str?

156 views
Skip to first unread message

Y Y

unread,
Sep 29, 2014, 1:59:31 AM9/29/14
to erpnext-dev...@googlegroups.com
Dear Team,

As subject, any chance?

Thanks,
Yang

Anand Doshi

unread,
Sep 29, 2014, 2:30:48 AM9/29/14
to erpnext-dev...@googlegroups.com
Can you check if the csv file has the key you are trying to translate?
--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/dac92023-49b2-4623-bfb6-f5520bfab7d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Y Y

unread,
Sep 29, 2014, 2:38:58 AM9/29/14
to erpnext-dev...@googlegroups.com
yes, it has in csv, I can give 2 examples:

1. Sale Order page, sales_order.js has include sales_taxt_and_charge_master.js, which later file translation won't be loaded.
2. Sale Lead, Contact part, it also include contact js which lead no translation be loaded

在 2014年9月29日星期一UTC+8下午2时30分48秒,Anand Doshi写道:
Can you check if the csv file has the key you are trying to translate?

On Monday, September 29, 2014, Y Y <yangy...@gmail.com> wrote:
Dear Team,

As subject, any chance?

Thanks,
Yang

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Sep 29, 2014, 2:46:20 AM9/29/14
to erpnext-dev...@googlegroups.com
So the problem lies in the sequence of execution. Check form/meta.py. 
First the included must be processed and only then the translations should be extracted. 

On Monday, September 29, 2014, Y Y <yangy...@gmail.com> wrote:
yes, it has in csv, I can give 2 examples:

1. Sale Order page, sales_order.js has include sales_taxt_and_charge_master.js, which later file translation won't be loaded.
2. Sale Lead, Contact part, it also include contact js which lead no translation be loaded

在 2014年9月29日星期一UTC+8下午2时30分48秒,Anand Doshi写道:
Can you check if the csv file has the key you are trying to translate?

On Monday, September 29, 2014, Y Y <yangy...@gmail.com> wrote:
Dear Team,

As subject, any chance?

Thanks,
Yang

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/dac92023-49b2-4623-bfb6-f5520bfab7d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e1d9321e-2cc9-4e86-8973-26bc074c93e0%40googlegroups.com.

Y Y

unread,
Sep 29, 2014, 2:48:49 AM9/29/14
to erpnext-dev...@googlegroups.com
can you post the file line number, i can follow-up and give the final update.

在 2014年9月29日星期一UTC+8下午2时46分20秒,Anand Doshi写道:
So the problem lies in the sequence of execution. Check form/meta.py. 
First the included must be processed and only then the translations should be extracted. 

On Monday, September 29, 2014, Y Y <yangy...@gmail.com> wrote:
yes, it has in csv, I can give 2 examples:

1. Sale Order page, sales_order.js has include sales_taxt_and_charge_master.js, which later file translation won't be loaded.
2. Sale Lead, Contact part, it also include contact js which lead no translation be loaded

在 2014年9月29日星期一UTC+8下午2时30分48秒,Anand Doshi写道:
Can you check if the csv file has the key you are trying to translate?

On Monday, September 29, 2014, Y Y <yangy...@gmail.com> wrote:
Dear Team,

As subject, any chance?

Thanks,
Yang

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Sep 29, 2014, 3:01:13 AM9/29/14
to erpnext-dev...@googlegroups.com
Start the trace from here: https://github.com/frappe/frappe/blob/v5.0/frappe/desk/form/meta.py#L170
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/bf920a95-d85c-4e57-b5e2-da3d383d88d1%40googlegroups.com.

Y Y

unread,
Sep 29, 2014, 3:04:25 AM9/29/14
to erpnext-dev...@googlegroups.com
I've worked with this, it generally will dig into translate.py get_dic method which in turn load doctype related message, if dig more futher,

we can see it will only load,say sale order, then it is
sale order.js
sale order list .js(i added)

if there is js included in sale_order.js, in this method, it doesn't load js file translation inside sale order.js

thanks.
yang

在 2014年9月29日星期一UTC+8下午3时01分13秒,Anand Doshi写道:

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Anand Doshi

unread,
Sep 29, 2014, 3:08:50 AM9/29/14
to erpnext-dev...@googlegroups.com
https://github.com/frappe/frappe/blob/v5.0/frappe/translate.py#L277

This line indicates that it does render include files. You can print the code variable value to check. 
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/94718cb0-dd74-4acc-a39b-82c337e93f3f%40googlegroups.com.

Y Y

unread,
Sep 29, 2014, 3:39:19 AM9/29/14
to erpnext-dev...@googlegroups.com
oh, seems this code doesn't exist in 4.*?


在 2014年9月29日星期一UTC+8下午3时08分50秒,Anand Doshi写道:
https://github.com/frappe/frappe/blob/v5.0/frappe/translate.py#L277


在 2014年9月29日星期一UTC+8下午3时01分13秒,Anand Doshi写道:

--
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages