[release-notes] Added lang-selecting magic index.html to build/

Pete Travis immanetize at fedoraproject.org
Tue Feb 26 01:16:12 UTC 2013


commit 55cb117ce4db69b6968d564c62da63e3047fc1b9
Author: Pete Travis <immanetize at fedoraproject.org>
Date:   Mon Feb 25 18:10:47 2013 -0700

    Added lang-selecting magic index.html to build/

 build/index.html |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/build/index.html b/build/index.html
new file mode 100644
index 0000000..5414c17
--- /dev/null
+++ b/build/index.html
@@ -0,0 +1,61 @@
+<html>
+<head>
+<script language="JavaScript1.2">
+<!-- Begin
+if (navigator.appName == 'Netscape')
+  var l1 = navigator.language;
+else
+  var l1 = navigator.browserLanguage;
+-->
+</script>
+
+<title>Release Notes</title>
+<body>
+<script type="text/javascript">
+  var lang = l1;
+  var match = 0;
+  var locales = [LOCALESTRING];
+
+  // Try for full match of lang_LOC
+  for(locale in locales)
+    {
+      if(lang == locales[locale])
+        {
+          match = 1;
+          break;
+        }
+    }
+
+  // Else try for match of lang
+  if(match == 0)
+    {
+      for(locale in locales)
+        {
+          var loc_lang = locales[locale].substring(0,2);
+          var language = lang.substring(0,2);
+
+          if(loc_lang == language)
+            {
+              lang = locales[locale];
+              match = 1;
+              break;
+            }
+        }
+    }
+
+  // Else default to en-US
+  if(match == 0)
+    {
+      lang = 'en-US';
+    }
+
+  window.location = lang + "/index.html";
+</script>
+</noscript>
+<p>
+<ul>
+</ul>
+</p>
+</noscript>
+</body>
+</html>


More information about the docs-commits mailing list