View Single Post
Old 07-26-2011, 02:03 AM   #7
Naderstouhy
Enthusiast
Naderstouhy began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jul 2011
Device: none
Thanks a lot Mr. kovid, my Code in case anyone wishes to use it is :


in the browse.py code is :

def add_routes(self, connect):
...
connect('browse_language', base_href+'/language', self.browse_language)

def browse_language(self, lang):
set_dyntranslators('lang')

in the localization.py :


def set_dyntranslators(newlang):

lang = newlang
if lang:
buf = iso639 = None
...

in html :

<a href="{prefix}/browse/language" id="nav-ar" title="The Arabic version of this webiste" OnClick='getElementById("htmltag").dir="rtl";getEl ementById("datebet").innerHTML= "التاريخ بين:";</a>



Quote:
Originally Posted by kovidgoyal View Post
You need to replace every instance of the use of _() in the server code with dynamic_translate() then you need to create an endpoint in browse.py that changes dynamic_translate. Then you need to create some HTML in browse.html that calls that endpoint.

Last edited by Naderstouhy; 07-26-2011 at 02:17 AM.
Naderstouhy is offline   Reply With Quote