On 1/13/06, Jorge Godoy <[EMAIL PROTECTED]> wrote: > Since calendar languages are different from what we have from the browser or > with cherrypy I thought about adding a new variable -- defaulting to 'en' -- > to choose the language. > > For example, there are two options for pt: pt and pt-utf8. One would never > get 'pt-utf8' automatically (and that would be my choice to use, since it is > "more correct" Portuguese). > > I am thinking on how to override that, though... Probably setting a variable > before the JSLink and putting some way to override it in __init__().
It can't really go in __init__ since the language served would vary from request to request. (Unless a new widget is being instantiated with each request...) Hmm... you can't really pass anything in to insert() in this case, because the javascript has already been placed by the time you reach insert(). You *could* do something like set cherrypy.request.calendar_language which then reflects what gets included. I'd advocate *trying* to guess the language to use if nothing is set there and using that if there is something set. > I just don't know what would happen if there are two (or more) different > calendars with two different languages on the same page (probably there will > be one instance of each JS and I don't know if they'll clash and if they don't > then the expected -- one calendar on each language -- behaviour would probably > be achieved...) but I'd consider that a bug, though... If we do go the cherrypy.request.calendar_language route, that would help ensure that only one language JS is included. Kevin

