https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113644

Revision: 113644
Author:   jdlrobson
Date:     2012-03-12 18:17:39 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
add locale global for handling languages and message function

for the benefit of the phonegap app

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/javascripts/application.js
    trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php

Modified: trunk/extensions/MobileFrontend/javascripts/application.js
===================================================================
--- trunk/extensions/MobileFrontend/javascripts/application.js  2012-03-12 
18:16:22 UTC (rev 113643)
+++ trunk/extensions/MobileFrontend/javascripts/application.js  2012-03-12 
18:17:39 UTC (rev 113644)
@@ -92,6 +92,9 @@
        init();
        return {
                init: init,
+               message: function(name) {
+                       return locale[ name ];
+               },
                utils: utilities
        };
 

Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php
===================================================================
--- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php   
2012-03-12 18:16:22 UTC (rev 113643)
+++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php   
2012-03-12 18:17:39 UTC (rev 113644)
@@ -61,8 +61,10 @@
                          //<![CDATA[
                                var title = "{$this->data['htmlTitle']}";
                                var scriptPath = 
"{$this->data['wgScriptPath']}";
-                               var showText = "{$buttonShowText}";
-                               var hideText = "{$buttonHideText}";
+                               var locale = {
+                                       "expand-section": "{$buttonShowText}",
+                                       "collapse-section": "{$buttonHideText}"
+                               };
                          //]]>
                        </script>
                  </head>


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to