Localize JavaScript

62 views
Skip to first unread message

Mirek Zvolský

unread,
Mar 16, 2016, 5:12:31 AM3/16/16
to web2py-users
Any idea how to localize JavaScript texts?

I think I need
generate some js code with objects/dictionaries (similar to web2py language files)
and make a function which will seek in this dictionaries.

Maybe gettext already has some support for this.
That leads me to the question if I should prefer web2py translation system or gettext at all?

Mirek Zvolský

unread,
Mar 23, 2016, 4:19:20 AM3/23/16
to web2py-users
no idea ?




Dne středa 16. března 2016 10:12:31 UTC+1 Mirek Zvolský napsal(a):

Leonel Câmara

unread,
Mar 23, 2016, 6:30:18 AM3/23/16
to web2py-users
Do it the same way the welcome application does in web2py_ajax.html

Mirek Zvolský

unread,
Mar 23, 2016, 7:52:34 AM3/23/16
to web2py-users
Thanks, that is not bad (and not good, but not bad).



Dne středa 23. března 2016 11:30:18 UTC+1 Leonel Câmara napsal(a):

Jeff Riley

unread,
May 28, 2016, 10:23:18 PM5/28/16
to web2py-users
All,  Ok I think this would help my situation, but I am missing how to execute the Ajax.  I have four views that contain the same javascript and would really like to move to the static js folder, but the javascript requires elements passed to the views from the controllers.  The "Drawtext" items surrounded by {{ }} are causing my issue.  I have attached one of the current views showing what I am dealing with.

Sorry for being so daft.
view_sheet_archive.html
Reply all
Reply to author
Forward
0 new messages