incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1336951 - in /incubator/ooo/ooo-site/trunk/content/download: download_new_dl.js globalvars_new_dl.js
Date Thu, 10 May 2012 23:22:10 GMT
Author: arielch
Date: Thu May 10 23:22:09 2012
New Revision: 1336951

URL: http://svn.apache.org/viewvc?rev=1336951&view=rev
Log:
Allow to set the language and turn off navigator language detection

Modified:
    incubator/ooo/ooo-site/trunk/content/download/download_new_dl.js
    incubator/ooo/ooo-site/trunk/content/download/globalvars_new_dl.js

Modified: incubator/ooo/ooo-site/trunk/content/download/download_new_dl.js
URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/download/download_new_dl.js?rev=1336951&r1=1336950&r2=1336951&view=diff
==============================================================================
--- incubator/ooo/ooo-site/trunk/content/download/download_new_dl.js (original)
+++ incubator/ooo/ooo-site/trunk/content/download/download_new_dl.js Thu May 10 23:22:09 2012
@@ -262,7 +262,9 @@ function getMirrorHost_asf_sf_mb_weighte
  * get array for language
  */
 function getArray() {
-	if (navigator.language)
+    if (NL_LANGUAGE != "" && NL_LANGUAGE != "null")
+        language = NL_LANGUAGE;
+	else if (navigator.language)
     	language = navigator.language;
   	else if (navigator.userLanguage)
     	language = navigator.userLanguage;
@@ -321,10 +323,19 @@ function getLanguage() {
 }
 
 /*
+ * set language in order to avoid navigator language detection
+ */
+function setLanguage(language) {
+    NL_LANGUAGE = language;
+}
+
+/*
  * get language for user-language in ISO format
  */
 function getLanguageISO() {
-	if (navigator.language)
+    if (NL_LANGUAGE != "" && NL_LANGUAGE != "null")
+        language = NL_LANGUAGE;
+    else if (navigator.language)
     	language = navigator.language;
   	else if (navigator.userLanguage)
     	language = navigator.userLanguage;
@@ -441,6 +452,17 @@ function getLink( version, mirror, schem
 		}
 	}
 }
+
+/*
+ * get link setting link language instead of letting the script detect it
+ * depends on getLink( version, mirror, schema ) and setLanguage( lang )
+ */
+function getLinkWithLang( version, language, mirror, schema ) {
+    setLanguage( language );
+    return getLink( version, mirror, schema );
+}
+
+
 /* getLink mods for new mirrors */
 
 function sourceforge_getLink(version, schema) {

Modified: incubator/ooo/ooo-site/trunk/content/download/globalvars_new_dl.js
URL: http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/download/globalvars_new_dl.js?rev=1336951&r1=1336950&r2=1336951&view=diff
==============================================================================
--- incubator/ooo/ooo-site/trunk/content/download/globalvars_new_dl.js (original)
+++ incubator/ooo/ooo-site/trunk/content/download/globalvars_new_dl.js Thu May 10 23:22:09
2012
@@ -145,6 +145,7 @@ var BETA_SCHEMA    = "new";
 //var TEST_MIRROR    = "mirrorbrain";
 //var TEST_SCHEMA    = "old";
 
-
+// Language set in setLanguage to turn off language-detection
+var NL_LANGUAGE = "";
 
 



Mime
View raw message