openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1607470 - /openoffice/ooo-site/trunk/content/download/test/download.js
Date Wed, 02 Jul 2014 20:28:06 GMT
Author: marcus
Date: Wed Jul  2 20:28:06 2014
New Revision: 1607470

URL: http://svn.apache.org/r1607470
Log:
Added a possibility to show a customized error text in the sub-red box when the default error
text cannot be correctly translated

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=1607470&r1=1607469&r2=1607470&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Wed Jul  2 20:28:06 2014
@@ -539,30 +539,50 @@ function isLanguageSupported() {
  * Depends on chosen OS, language and version
  */
 function checkForLinkExceptions() {
-	// If recognized platform is not Windows, Linux or Mac, show the none-availability to the
user.
+	// If recognized resp. selected platform, language or version does not lead to a normal
download link,
+	// show the none-availability to the user.
 
-	var error_text = "";
 	SHOW_SUB_BOX   = true;
 	ERROR	       = false;
 
 	// If language is not supported, show the none-availability to the user.
 	if( ! isLanguageSupported() ) {
 		// Show an error message that the chosen items do not lead to a download.
-		error_text = "<b>" + l10n_download_error_problem_text + "</b>" + l10n_download_error_aoo_text
+ VERSION_SEL
-			     + l10n_download_error_not_available_for_text + "<b>" + RELEASE_LANG[ 1 ] +
" ("
-			     + RELEASE_LANG[ 2 ] + ") (" + LANG_SEL + ")</b>."
-			     + "<br /><b>" + l10n_download_error_solution_text + "</b>"
-			     + l10n_download_error_please_select_4_text;
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_4_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + RELEASE_LANG[ 1 ] + " (" + RELEASE_LANG[ 2 ] + ") (" + LANG_SEL + ")</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_4_text;
+		} else
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_4_text;
 
 		showErrorMessage( error_text );
 	}
 
+	// If the browser-guessed platform is not supported, show the none-availability to the user.
 	if( UI_PLATFORM_NO_SUP !== "" ) {
 		// Show an error message that the chosen items do not lead to a download.
-		error_text = "<b>" + l10n_download_error_problem_text + "</b>" + l10n_download_error_aoo_text
+ VERSION_SEL
-			     + l10n_download_error_not_available_for_text + "<b>" + UI_PLATFORM_NO_SUP +
"</b>."
-			     + "<br /><b>" + l10n_download_error_solution_text + "</b>"
-			     + l10n_download_error_please_select_3_text;
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_3_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM_NO_SUP + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_3_text;
+		} else
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_3_text;
 
 		showErrorMessage( error_text );
 	}
@@ -570,21 +590,41 @@ function checkForLinkExceptions() {
 	// If version is '4.1.0' (or newer) and platform is 'Mac OS X <= 10.6', show the none-availability
to the user.
 	if( VERSION_SEL === "4.1.0" && PLATFORM === "mac32" ) {
 		// Show an error message that the chosen items do not lead to a download.
-		error_text = "<b>" + l10n_download_error_problem_text + "</b>" + l10n_download_error_aoo_text
+ VERSION_SEL
-			     + l10n_download_error_not_available_for_text + "<b>" + UI_PLATFORM + "</b>."
-			     + "<br /><b>" + l10n_download_error_solution_text + "</b>"
-			     + l10n_download_error_please_select_1_text;
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_1_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_1_text;
+		} else
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_1_text;
 
 		showErrorMessage( error_text );
 	}
 
 	// If version is '4.0.1' (or older) and platform is 'Mac OS X >= 10.7', show the none-availability
to the user.
 	if( ( VERSION_SEL === "4.0.1" || VERSION_SEL === "4.0.0" ) && PLATFORM === "mac64"
) {
-		// Set the values for all elements that should not be empty.
-		error_text = "<b>" + l10n_download_error_problem_text + "</b>" + l10n_download_error_aoo_text
+ VERSION_SEL
-			     + l10n_download_error_not_available_for_text + "<b>" + UI_PLATFORM + "</b>."
-			     + "<br /><b>" + l10n_download_error_solution_text + "</b>"
-			     + l10n_download_error_please_select_2_text;
+		// Show an error message that the chosen items do not lead to a download.
+
+		// If a customized string is not available in the "msg_prop_l10n_XX.js" file.
+		if( l10n_download_error_custom_2_text === "" ) {
+			// Show the default error text.
+			var error_text = "<b>" + l10n_download_error_problem_text + "</b>"
+					+ l10n_download_error_aoo_text + VERSION_SEL
+					+ l10n_download_error_not_available_for_text
+					+ "<b>" + UI_PLATFORM + "</b>."
+					+ "<br />"
+					+ "<b>" + l10n_download_error_solution_text + "</b>"
+					+ l10n_download_error_please_select_2_text;
+		} else
+			// Show the customized error text.
+			var error_text = l10n_download_error_custom_2_text;
 
 		showErrorMessage( error_text );
 	}
@@ -695,11 +735,15 @@ function getLinkSelection() {
 		document.getElementById( "dl_lp_link"	    ).title	= l10n_download_langpack_link_title +
FILENAME_LP;
 
 		// Set the values in the sub-box for the 3 text lines.
-		document.getElementById( "dl_rel_info"      ).innerHTML	= "<b>" + l10n_download_rel_info_headline_text
+ "</b> " + REL_TEXT + " | ";
+		document.getElementById( "dl_rel_info"      ).innerHTML	= "<b>" + l10n_download_rel_info_headline_text
+									+ "</b> " + REL_TEXT + " | ";
 		document.getElementById( "dl_rel_notes"	    ).href	= REL_NOTES;
 		document.getElementById( "dl_rel_notes"	    ).innerHTML	= l10n_download_rel_notes_text;
 		document.getElementById( "dl_rel_notes"	    ).title	= l10n_download_rel_notes_title + VERSION_SEL;
-		document.getElementById( "dl_f_info"	    ).innerHTML = "<b>" + l10n_download_headline_full_text
+ "</b>" + l10n_download_filesize_text + FILESIZE_FULL + l10n_download_megabyte_text
+ " | " + l10n_download_checksum_headline_text;
+		document.getElementById( "dl_f_info"	    ).innerHTML = "<b>" + l10n_download_headline_full_text
+ "</b>"
+									+ l10n_download_filesize_text + FILESIZE_FULL
+									+ l10n_download_megabyte_text + " | "
+									+ l10n_download_checksum_headline_text;
 		document.getElementById( "dl_f_chk_keys"    ).href	= LINK_CHK_KEYS;
 		document.getElementById( "dl_f_chk_keys"    ).innerHTML	= l10n_download_checksum_keys_text;
 		document.getElementById( "dl_f_chk_keys"    ).title	= l10n_download_checksum_keys_title;
@@ -715,7 +759,10 @@ function getLinkSelection() {
 		document.getElementById( "dl_f_chk_sha256"  ).href	= LINK_CHK_SHA256_FULL;
 		document.getElementById( "dl_f_chk_sha256"  ).innerHTML	= l10n_download_checksum_sha256_text;
 		document.getElementById( "dl_f_chk_sha256"  ).title	= l10n_download_checksum_sha256_title
+ FILENAME_FULL;
-		document.getElementById( "dl_lp_info"	    ).innerHTML	= "<b>" + l10n_download_headline_langpack_text
+ "</b>" + l10n_download_filesize_text + FILESIZE_LP + l10n_download_megabyte_text +
" | " + l10n_download_checksum_headline_text;
+		document.getElementById( "dl_lp_info"	    ).innerHTML	= "<b>" + l10n_download_headline_langpack_text
+									+ "</b>" + l10n_download_filesize_text
+									+ FILESIZE_LP + l10n_download_megabyte_text
+									+ " | " + l10n_download_checksum_headline_text;
 		document.getElementById( "dl_lp_chk_keys"   ).href	= LINK_CHK_KEYS;
 		document.getElementById( "dl_lp_chk_keys"   ).innerHTML	= l10n_download_checksum_keys_text;
 		document.getElementById( "dl_lp_chk_keys"   ).title	= l10n_download_checksum_keys_title;



Mime
View raw message