This not worked for me, the idea was to insert a folder record with the name in the user language, hence translating "My Dashboard" to anything if we got a translation string for that language.
Apart from that part, all the texts are being translated without any problem, urrrr 2016-12-12 9:09 GMT-05:00 Yoel Benítez Fonseca <ybenit...@gmail.com>: > On Sun, 11 Dec 2016 15:32:41 -0800 (PST) > Marlysson Silva <marlyss...@gmail.com> wrote: > >> You can overrride programatically the language getting accepted >> language header from client using : >> >> language = response.headers['Accept-Language'].lower() >> >> T.force(language) > > I think got what is wrong, the controller in particular with execute my > code was on a ajax request, i have tested on a normal request and it do > what is suppose to do. > > Thanks folks, i'll test setting is programatically. > >> >> Em sábado, 10 de dezembro de 2016 11:18:46 UTC-3, Yoel Benitez >> Fonseca escreveu: >> > >> > Hi, folks, this is in my controller: >> > >> > >> > if not dash_list: >> > # create a new dashboard >> > d_id = db.dashboard.insert( >> > name=T('My Dashboard', lazy=False), item_list=[]) >> > query = (db.dashboard.id > 0) >> > query &= (db.dashboard.created_by == auth.user.id) >> > dash_list = db(query).select(db.dashboard.ALL) >> > auth.add_permission(0, 'owner', db.dashboard, d_id) >> > >> > The logic is simple, if there is not a dashboard create one called >> > "My dashboard". The problem comes from not English users, they get >> > the same name. >> > >> > I have verified the languages files, and the accepted language >> > header, all is fine, in the shell it work's correctly - prior >> > setting the language oc. >> > >> > Some idea ? >> > >> > -- Yoel Benítez Fonseca http://redevil.cubava.cu/ $ python -c "import this" -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.