Author: marcus
Date: Tue Jul  8 22:56:23 2014
New Revision: 1608966

URL: http://svn.apache.org/r1608966
Log:
Added logic to get localized UI names into the select boxes

Modified:
    openoffice/ooo-site/trunk/content/download/test/download.js

Modified: openoffice/ooo-site/trunk/content/download/test/download.js
URL: 
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download.js?rev=1608966&r1=1608965&r2=1608966&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Tue Jul  8 
22:56:23 2014
@@ -239,6 +239,16 @@ DL.fillOSSelection = function() {
                selection.appendChild( option );
        }
 
+       // Check if the option names are localized. 
+       // If the first string in the array element is larger than 0, assume 
all are localized and should be used.
+       if ( l10n_download_green_box_select_box_os_values[ 0 ].length > 0 ) {
+               // Search through the localized names.
+               for( i = 0, j = 
l10n_download_green_box_select_box_os_values.length; i < j; i++ ) {
+                       // Exchange only the default UI platform name with the 
localized name.
+                       selection.options[ i ].text = 
l10n_download_green_box_select_box_os_values[ i ];
+               }
+       }
+
        return;
 }
 
@@ -264,6 +274,16 @@ DL.fillLanguageSelection = function() {
                selection.appendChild( option );
        }
 
+       // Check if the option names are localized. 
+       // If the first string in the array element is larger than 0, assume 
all are localized and should be used.
+       if ( l10n_download_green_box_select_box_language_values[ 0 ].length > 0 
) {
+               // Search through the localized names.
+               for( i = 0, j = 
l10n_download_green_box_select_box_language_values.length; i < j; i++ ) {
+                       // Exchange only the default language name with the 
localized name.
+                       selection.options[ i ].text = 
l10n_download_green_box_select_box_language_values[ i ];
+               }
+       }
+
        return;
 }
 
@@ -287,6 +307,16 @@ DL.fillVersionSelection = function() {
                selection.appendChild( option );
        }
 
+       // Check if the option names are localized. 
+       // If the first string in the array element is larger than 0, assume 
all are localized and should be used.
+       if ( l10n_download_green_box_select_box_version_values[ 0 ].length > 0 
) {
+               // Search through the localized names.
+               for( i = 0, j = 
l10n_download_green_box_select_box_version_values.length; i < j; i++ ) {
+                       // Exchange only the default version name with the 
localized name.
+                       selection.options[ i ].text = 
l10n_download_green_box_select_box_version_values[ i ];
+               }
+       }
+
        return;
 }
 
@@ -315,7 +345,7 @@ DL.setOSSelection = function() {
                // Default: Assign "Windows".
                for( var i = 0, j = DL.SEL_OS.length; i < j; i = i + 3 ) {
                        // If the platform was found, set it as pre-selected.
-                       if( DL.SEL_OS[ i ] === "Win_x86_install" ) {
+                       if( DL.SEL_OS[ i ] === "win32" ) {
                                selection.selectedIndex = i / 3;
                                break;
                        }


Reply via email to