Hi Colin & Justin,

I have attached the patch for the FLUID progress demo page. I have cleaned up 
the progress.js by adding an string object to hold the strings that we use to 
display status of our progress in progress demo html page.

Thanks,

Golam Chowdhury
[email protected] | 416-977-6000 ext. 3962
Software Developer
Inclusive Design Research Centre (IDRC)
OCAD University
Index: FLUID-3751/src/webapp/components/progress/js/Progress.js
===================================================================
--- FLUID-3751/src/webapp/components/progress/js/Progress.js	(revision 10112)
+++ FLUID-3751/src/webapp/components/progress/js/Progress.js	(working copy)
@@ -170,7 +170,7 @@
            
     /**
     * Instantiates a new Progress component.
-    * 
+    * hideProgress
     * @param {jQuery|Selector|Element} container the DOM element in which the Uploader lives
     * @param {Object} options configuration options for the component.
     */
Index: FLUID-3751/src/webapp/demos/progress/js/progress.js
===================================================================
--- FLUID-3751/src/webapp/demos/progress/js/progress.js	(revision 10113)
+++ FLUID-3751/src/webapp/demos/progress/js/progress.js	(working copy)
@@ -76,7 +76,7 @@
        
         var timer = timeSimulator(percent, steps);         
          
-        // set initial aria roles and aria-controls to some of the containers
+        // set default aria roles and aria-controls to some of the containers
         statusArea.attr("role", "status");
         submitButton.attr("aria-controls", "status-message");
          
@@ -84,8 +84,7 @@
         restartDemo.hide();        
          
         // initialize text on element with the class status-text
-        // TODO: Language strings should be external to code.
-        statusText.text("Confirm and submit your order.");
+        statusText.text(demo.initShoppingDemo.strings.confirmStatus);
                 
         // here's where we create the progress component
         var myProgress = fluid.progress("#progress-container", {
@@ -103,9 +102,8 @@
         
         var myFinishFunction = function () {
             myProgress.container.fadeOut("slow", function () {
-                // change text on element with class status-text after  progress simulation is complete   
-                // TODO: More English strings in code
-                statusText.text("Order Submitted. Demo finished.").show();            
+                // change text on element with class status-text after  progress simulation is complete
+                statusText.text(demo.initShoppingDemo.strings.orderSubmitted).show();                 
                 // set the live region attributes to the div element
                 setAriaLiveRegionAttr(liveRegion);            
                 // re-enable the link to restart the demo
@@ -115,9 +113,10 @@
         
         // progress component specific
         var stepFunction = function (percent) {
-             // create a label for the progress
-             // TODO: English string in code
-            var currentProgressLabel = percent + "% Complete";            
+            // create a label for the progress
+            var currentProgressLabel = fluid.stringTemplate(demo.initShoppingDemo.strings.percentCompleted, {
+                percent: percent    
+            });            
             // tell progress to update
             myProgress.update(percent, currentProgressLabel);
         };
@@ -134,5 +133,12 @@
             statusText.hide();             
         });   
     };
+    
+    // Strings which are used in the html to give user feedback
+    demo.initShoppingDemo.strings = {
+        confirmStatus: "Confirm and submit your order.",
+        orderSubmitted: "Order Submitted. Demo finished.",
+        percentCompleted: "%percent% Complete"
+    };
 
 })(jQuery, fluid);
_______________________________________________________
fluid-work mailing list - [email protected]
To unsubscribe, change settings or access archives,
see http://fluidproject.org/mailman/listinfo/fluid-work

Reply via email to