Author: marcus
Date: Sat Jul 12 20:34:11 2014
New Revision: 1610042
URL: http://svn.apache.org/r1610042
Log:
Show the language name in English or as loalized string for the select box
items and the native name + ISO code as tool tip
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=1610042&r1=1610041&r2=1610042&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Sat Jul 12
20:34:11 2014
@@ -1,6 +1,7 @@
/*
* Overview of all methods (functions) defined below of the global object "DL"
* ---------------------------------------------------------------------------
+ * function DL.init ()
* function DL.initVariables ()
* function DL.getLanguage ()
* function DL.fillOSSelection ()
@@ -25,7 +26,6 @@
*
* Overview of global functions defined below
* ------------------------------------------
- * function init ()
* function openItem ( itemid, uri )
*/
@@ -264,14 +264,20 @@ DL.fillLanguageSelection = function() {
var option = "";
// Fill the <select> element until all languages are used.
- for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 2 ) {
+ for( var i = 0, j = DL.SEL_LANG.length; i < j; i = i + 3 ) {
option = document.createElement( "option" );
// Assign the language ISO code as index value.
option.value = DL.SEL_LANG[ i ];
+/*
// Assign the language ISO code as title.
option.title = DL.SEL_LANG[ i ];
// Assign the language name as "English name (Native name)".
option.text = DL.SEL_LANG[ i + 1 ];
+*/
+ // Assign the language name as "Native name" (or English name
if localization is not available).
+ option.text = DL.SEL_LANG[ i + 1 ];
+ // Assign the language as "English name (ISO code)" as title.
+ option.title = DL.SEL_LANG[ i + 2 ];
// Add the new option to the already existing ones.
selection.appendChild( option );
}
@@ -283,6 +289,12 @@ DL.fillLanguageSelection = function() {
for( i = 0, j =
l10n.dl_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.dl_green_box_select_box_language_values[ i ];
+/*
+ alert( "i: \t\t" + i + "\n"
+ + "Localized: \t" +
l10n.dl_green_box_select_box_language_values[ i ] + "\n"
+ + "Text: \t\t" + selection.options[ i
].text + "\n"
+ + "Title: \t\t" + selection.options[ i
].title );
+*/
}
}