Which file prepare the style and script [ERPNEXT]

Can you push your updates (so far) in your fork so that I can see what are you doing? It will be much easier to understand and maybe I can suggest how to get to the next step rather than giving suggestions based on incomplete understanding.


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 12:21 PM, Syed Qadeer <sd...@gmail.com> wrote:

yes i am trying to implement RTL and as well as some different styling for non-english users.

On Wednesday, 27 February 2013 09:42:22 UTC+3, rushabh wrote:
Are you trying to implement RTL?


On 27-Feb-2013, at 12:08 PM, Syed Qadeer <sd...@gmail.com> wrote:

i am trying to change the css based upon the user-preferred language ... thats one of my requirements ...

if i could set the userlanguage session in the session.py then everything is sorted out.

On Wednesday, 27 February 2013 09:29:25 UTC+3, rushabh wrote:
Syed,

What are you trying to achieve? Only web pages are cached. Have not extended the multi-lingual feature to the website yet. That is a bit to-do and I am not sure of the architecture.

For the internal Pages, you should use wn._("text") in your javascript and those texts will automatically be scraped and appropriate translations appended.

If the user language changes mid-way, then they have to refresh the page.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 11:15 AM, Syed Qadeer <sd...@gmail.com> wrote:

but , if i set the user language after all the pages processing is done and cached ,then in the auth.py i am getting the user-preferred language , when everything is cached and saved,it would be of no use to me ... as it will always display the same content for english but i have some more content to be displayed for an user with different language.

On Tuesday, 26 February 2013 08:43:40 UTC+3, Syed Qadeer wrote:

i have the virtual machine for the ERPNEXT , i am trying to change the little code to meet my needs and requirements.

so i am trying to change the UI and the javascript.

for example : lets take the Desktop folder from the Apps/Home/Desktop

there are 3 files , desktop.html , desktop.css and desktop.js

i wanted to know , which file is responsible for taking the desktop.css and desktop.js and converting them into the internal javascript and internal css

so that i can do my tweaks.

NOTE : i know that i can write the code in desktop.css and desktop.js , if i want to change the look and feel , but since i am interested in knowing which file is responsible for the conversion so that i can tweak with that module.

waiting for your favourable response.

warm regards.

</blockquote><div><br></div>



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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/iWnaprs2rnoJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to erpnext-dev…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/X5DSoCL-rrAJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/qvTUtmkHOigJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

core/doctype/page/page.py


# css
lang = “”
                if(webnotes.lang != “en”)
                        lang = “_ar”

fpath = os.path.join(path, scrub(self.doc.name) + lang + ‘.css’)

but here webnotes.lang is always “en”

so i thought of setting a session from the session.py

def start(self):
“”“start a new session”“”
import os
import webnotes
import webnotes.utils
# generate sid
if webnotes.login_manager.user==‘Guest’:
sid = ‘Guest’
else:
sid = webnotes.generate_hash()
user_lang_pref = webnotes.conn.get_value(“Profile”, webnotes.login_manager.user, “language”)
self.data[‘data’][‘userLang’] = user_lang_pref
                        # i know user_lang_pref will be in arabic it will not be “ar” well this is what i was testing but it is not working over here.



On Wednesday, 27 February 2013 09:58:03 UTC+3, rushabh wrote:
Can you push your updates (so far) in your fork so that I can see what are you doing? It will be much easier to understand and maybe I can suggest how to get to the next step rather than giving suggestions based on incomplete understanding.



W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 12:21 PM, Syed Qadeer <sd...@gmail.com> wrote:

yes i am trying to implement RTL and as well as some different styling for non-english users.

On Wednesday, 27 February 2013 09:42:22 UTC+3, rushabh wrote:
Are you trying to implement RTL?


On 27-Feb-2013, at 12:08 PM, Syed Qadeer <sd...@gmail.com> wrote:

i am trying to change the css based upon the user-preferred language ... thats one of my requirements ...

if i could set the userlanguage session in the session.py then everything is sorted out.

On Wednesday, 27 February 2013 09:29:25 UTC+3, rushabh wrote:
Syed,

What are you trying to achieve? Only web pages are cached. Have not extended the multi-lingual feature to the website yet. That is a bit to-do and I am not sure of the architecture.

For the internal Pages, you should use wn._("text") in your javascript and those texts will automatically be scraped and appropriate translations appended.

If the user language changes mid-way, then they have to refresh the page.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 11:15 AM, Syed Qadeer <sd...@gmail.com> wrote:

but , if i set the user language after all the pages processing is done and cached ,then in the auth.py i am getting the user-preferred language , when everything is cached and saved,it would be of no use to me ... as it will always display the same content for english but i have some more content to be displayed for an user with different language.

On Tuesday, 26 February 2013 08:43:40 UTC+3, Syed Qadeer wrote:

i have the virtual machine for the ERPNEXT , i am trying to change the little code to meet my needs and requirements.

so i am trying to change the UI and the javascript.

for example : lets take the Desktop folder from the Apps/Home/Desktop

there are 3 files , desktop.html , desktop.css and desktop.js

i wanted to know , which file is responsible for taking the desktop.css and desktop.js and converting them into the internal javascript and internal css

so that i can do my tweaks.

NOTE : i know that i can write the code in desktop.css and desktop.js , if i want to change the look and feel , but since i am interested in knowing which file is responsible for the conversion so that i can tweak with that module.

waiting for your favourable response.

warm regards.

</blockquote><div><br></div>



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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/iWnaprs2rnoJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/X5DSoCL-rrAJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to erpnext-dev…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/qvTUtmkHOigJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/NeaWq3_p4w4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

so rusabh, anything that you can help me with ??

On Tuesday, 26 February 2013 08:43:40 UTC+3, Syed Qadeer wrote:


i have the virtual machine for the ERPNEXT , i am trying to change the little code to meet my needs and requirements.

so i am trying to change the UI and the javascript.

for example : lets take the Desktop folder from the Apps/Home/Desktop

there are 3 files , desktop.html , desktop.css and desktop.js

i wanted to know , which file is responsible for taking the desktop.css and desktop.js and converting them into the internal javascript and internal css

so that i can do my tweaks.

NOTE : i know that i can write the code in desktop.css and desktop.js , if i want to change the look and feel , but since i am interested in knowing which file is responsible for the conversion so that i can tweak with that module.

waiting for your favourable response.

warm regards.

</div></blockquote>



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+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/4DTKB1NEqMEJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

How are you linking it into css? what is user_lang_pref

What I meant was push into your fork at github.


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 12:38 PM, Syed Qadeer <sd...@gmail.com> wrote:

core/doctype/page/page.py

# css
lang = ""
                if(webnotes.lang != "en")
                        lang = "_ar"

fpath = os.path.join(path, scrub(self.doc.name) + lang + '.css')

but here webnotes.lang is always "en"

so i thought of setting a session from the session.py

def start(self):
"""start a new session"""
import os
import webnotes
import webnotes.utils
# generate sid
if webnotes.login_manager.user=='Guest':
sid = 'Guest'
else:
sid = webnotes.generate_hash()
user_lang_pref = webnotes.conn.get_value("Profile", webnotes.login_manager.user, "language")
self.data['data']['userLang'] = user_lang_pref
                        # i know user_lang_pref will be in arabic it will not be "ar" well this is what i was testing but it is not working over here.



On Wednesday, 27 February 2013 09:58:03 UTC+3, rushabh wrote:
Can you push your updates (so far) in your fork so that I can see what are you doing? It will be much easier to understand and maybe I can suggest how to get to the next step rather than giving suggestions based on incomplete understanding.


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 12:21 PM, Syed Qadeer <sd...@gmail.com> wrote:

yes i am trying to implement RTL and as well as some different styling for non-english users.

On Wednesday, 27 February 2013 09:42:22 UTC+3, rushabh wrote:
Are you trying to implement RTL?


On 27-Feb-2013, at 12:08 PM, Syed Qadeer <sd...@gmail.com> wrote:

i am trying to change the css based upon the user-preferred language ... thats one of my requirements ...

if i could set the userlanguage session in the session.py then everything is sorted out.

On Wednesday, 27 February 2013 09:29:25 UTC+3, rushabh wrote:
Syed,

What are you trying to achieve? Only web pages are cached. Have not extended the multi-lingual feature to the website yet. That is a bit to-do and I am not sure of the architecture.

For the internal Pages, you should use wn._("text") in your javascript and those texts will automatically be scraped and appropriate translations appended.

If the user language changes mid-way, then they have to refresh the page.

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 27-Feb-2013, at 11:15 AM, Syed Qadeer <sd...@gmail.com> wrote:

but , if i set the user language after all the pages processing is done and cached ,then in the auth.py i am getting the user-preferred language , when everything is cached and saved,it would be of no use to me ... as it will always display the same content for english but i have some more content to be displayed for an user with different language.

On Tuesday, 26 February 2013 08:43:40 UTC+3, Syed Qadeer wrote:

i have the virtual machine for the ERPNEXT , i am trying to change the little code to meet my needs and requirements.

so i am trying to change the UI and the javascript.

for example : lets take the Desktop folder from the Apps/Home/Desktop

there are 3 files , desktop.html , desktop.css and desktop.js

i wanted to know , which file is responsible for taking the desktop.css and desktop.js and converting them into the internal javascript and internal css

so that i can do my tweaks.

NOTE : i know that i can write the code in desktop.css and desktop.js , if i want to change the look and feel , but since i am interested in knowing which file is responsible for the conversion so that i can tweak with that module.

waiting for your favourable response.

warm regards.

</blockquote><div><br></div>



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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/iWnaprs2rnoJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/X5DSoCL-rrAJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to erpnext-dev…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/qvTUtmkHOigJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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+un…@googlegroups.com.

To post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/NeaWq3_p4w4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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+un...@googlegroups.com.

To post to this group, send email to er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.