You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ma...@apache.org on 2017/12/11 20:31:18 UTC

svn commit: r1817821 - /openoffice/ooo-site/trunk/content/download/download.js

Author: marcus
Date: Mon Dec 11 20:31:18 2017
New Revision: 1817821

URL: http://svn.apache.org/viewvc?rev=1817821&view=rev
Log:
Select box for languages: Changes for localized strings that can be sorted individual

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

Modified: openoffice/ooo-site/trunk/content/download/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/download.js?rev=1817821&r1=1817820&r2=1817821&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/download.js Mon Dec 11 20:31:18 2017
@@ -128,6 +128,13 @@ DL.initVariables = function( init_all )
 	DL.SHOW_SUB_BOX			= true;	 // Is the download URL OK to show the sub-box (true) or not (false)?
 	DL.ERROR			= false; // Is the download URL in general OK (false) or not (true)?
 
+	// Check if all option names in the selection box for languages are localized.
+	// If the first string in the array element is larger than 0, assume all are localized and should be used.
+	// Otherwise use the default names.
+	if ( l10n.dl_green_box_select_box_lang_values_custom[ 0 ].length > 0 ) {
+		DL.SEL_LANG = l10n.dl_green_box_select_box_lang_values_custom;
+	}
+
 	return;
 }
 
@@ -283,7 +290,7 @@ DL.fillLanguageSelection = function() {
 		selection.appendChild( option );
 	}
 
-	// Check if the option names are localized. 
+	// Check if only 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.dl_green_box_select_box_language_values[ 0 ].length > 0 ) {
 		// Search through the localized names.
@@ -465,13 +472,14 @@ DL.getLanguageSelection = function() {
 	// Search through the <select> element until the chosen language is found.
 	for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
 		if( DL.SEL_LANG[ i ] === language_value ) {
-			DL.LANG_SEL = language_value;
+			DL.SEL_LANG = language_value;
 			break;
 		}
 	}
 
-	DL.LANG_ISO = DL.LANG_SEL;
-	return DL.LANG_SEL;
+	DL.LANG_ISO = DL.SEL_LANG;
+	DL.LANG_SEL = DL.SEL_LANG;
+	return DL.SEL_LANG;
 }
 
 /*