javascript alert/confirm/prompt internationalization
-
semias
There is another variant of this "issue".
For instance: when generating .spt files by defining te spt contents as a string variable, the {intl } tags are ignored by the translation indexer.
Solving this is done by adding a _translate() function, which explicitly runs through all strings in a php file and adds them to the translation table.
example:
source: /saf/lib/GUI/DataGrid.php var $template = ' {if obj.addUrl} <p><a href="{addUrl}?collection={collection}">{intl Add Item}</a></p> {end if} '; function _translate () { intl_get ('Add Item'); }This way, the {intl } tags are discovered and the text is made translatable.
-
semias
Sometimes javascript is called using a "define" function. Here the javascript is encapsulated in quotes, so the PHP code has to be inserted in a different manner.
Example:Source: /inc/app/sitemailer2/conf/properties.php $intl_confirm = intl_get("Are you sure you want to delete this item?"); define ('CMS_JS_DELETE_CONFIRM', '<script language="javascript" type="text/javascript"> <!-- function cms_delete_confirm () { return confirm ("' . $intl_confirm . '"); } // --> </script>'); -
semias
- State changed from new to open
Every alert and confirm pop-up window has been internationalized.
There is one exception located at:/inc/app/siteblog/lib/Filters.php:50-52It is possible to translate the given strings, but for some reason they are not translated in the actual view. (which is located in the control panel > content > blog comments)
-
semias
- State changed from open to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.