Following on from the localization process described in my earlier post, here's how it rolls when I'm using the brilliant jQueryUI modal dialogs.
A lot of the application's web pages use the same modal dialog, for example to choose a customer. I have used ASP.net usercontrols to wrap up the HTML/ASP.net markup and then re-use them throughout the application.
The usercontrol contains a jTemplates template to build a table based on the result of a jQuery ajax call.
Datatables.js is used to enable paging and searching.
Excuse the endscript tag included in the below snippet, but SyntaxHighlighter was interpreting the closing script tag as the end of the code snippet.
I am able to use the same ExpressionBuilder based localisation technique within the user control to provide translations for the labels of the buttons and column headers. Even within the jTemplates script, the ASP.Net engine recognises the ExpressionBuilder tags and evaluates them accordingly.
The one item that I was not able to translate directly was the dialog title supplied in the call to the jQueryUI dialog function. Instead of a direct attack, a flanking maneuver was required.
Inside each usercontrol's declaration, I include a hidden input form whose value is set using my ExpressionBuilder Translate function. A CSS class of "title" is assigned to it. When instantiating the dialog, I pass reference to this hidden field for assigning the dialog title.
No comments:
Post a Comment