[library-web/new-website-style: 10/55] Moving language selection to a custom page
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web/new-website-style: 10/55] Moving language selection to a custom page
- Date: Sat, 19 Mar 2011 18:57:25 +0000 (UTC)
commit 726e10a06e23ffb0d82ba352d7e988a9bb7a65eb
Author: Frédéric Péters <fpeters 0d be>
Date: Sat Dec 4 13:28:58 2010 +0100
Moving language selection to a custom page
data/catalog.xml.in | 2 +
data/js/language.js | 17 ++++--
data/skin/lgo2010.css | 9 +++-
data/xslt/heading.xsl | 6 ++-
data/xslt/indexes.xsl | 133 ++++++++++++++++++++++++++-----------------------
5 files changed, 96 insertions(+), 71 deletions(-)
---
diff --git a/data/catalog.xml.in b/data/catalog.xml.in
index dcd822f..e745586 100644
--- a/data/catalog.xml.in
+++ b/data/catalog.xml.in
@@ -82,4 +82,6 @@ find information on tools and methods to work with many GNOME desktops.
<_msgstr msgid="nightly-version">Nightly</_msgstr>
<_msgstr msgid="devel-resource">External Tools and Resources</_msgstr>
<_msgstr msgid="ApplicationsProgramming">Manuals</_msgstr>
+ <_msgstr msgid="switchlang">Switching Language</_msgstr>
+ <_msgstr msgid="activelang">Active Language:</_msgstr>
</msgcat>
diff --git a/data/js/language.js b/data/js/language.js
index faf522f..3a9f2e1 100644
--- a/data/js/language.js
+++ b/data/js/language.js
@@ -31,13 +31,18 @@ if(url.indexOf('.html.'+lang) != -1) {
setCookie('language', lang, 30);
}
-
-if (clang = getCookie('language')) {
- if (clang == lang) {
- text = language_cookie_text;
- } else {
+function display_missing_translation_text()
+{
+ if (clang = getCookie('language')) {
text = language_missing_text;
+ document.write('<p>' + text + '</p>')
}
- document.write('<p>' + text + '</p><p><a href="#" onclick="removeLangCookie(); return false;">' + remove_cookie_text + '</a></p>');
}
+function display_remove_cookie_text()
+{
+ if (clang = getCookie('language')) {
+ document.write('<p>' + language_cookie_text + '</p>')
+ document.write('<p><a href="/" onclick="removeLangCookie(); return true;">' + remove_cookie_text + '</a></p>');
+ }
+}
diff --git a/data/skin/lgo2010.css b/data/skin/lgo2010.css
index b3545a0..41b61d9 100644
--- a/data/skin/lgo2010.css
+++ b/data/skin/lgo2010.css
@@ -79,4 +79,11 @@ dl.doc-index dt span.module-more a {
font-weight: normal;
}
-
+ul.language-list {
+ -webkit-column-width: 15em;
+ -webkit-column-gap: 2em;
+ -moz-column-width: 15em;
+ -moz-column-gap: 2em;
+ column-width: 15em;
+ column-gap: 2em;
+}
diff --git a/data/xslt/heading.xsl b/data/xslt/heading.xsl
index 8f5f1b6..bddf4bb 100644
--- a/data/xslt/heading.xsl
+++ b/data/xslt/heading.xsl
@@ -174,7 +174,11 @@ $('#s').autocomplete('/symbols/lookup/',
</li>
</ul></div> </div>
<div class="links grid_3 right">
- <div><ul class="menu available_languages"><li><strong>Also available in:</strong><ul class="sub-menu"><li class="active"><a href="http://wptest.gnome.org/support/" title="English">English</a></li><li><a href="http://wptest.gnome.org/pt-br/" title="Portuguese (Brazil)">Português</a></li></ul></li></ul></div> </div>
+ <div><ul class="menu available_languages"><li><strong>This website is available in many languages</strong><ul class="sub-menu"><li><a href="/languages" title="Switching Language">Switching Language...</a></li></ul></li></ul>
+
+ <script type="text/javascript" src="/js/language.js" />
+
+ </div> </div>
<!-- footnotes -->
<div id="footnotes" class="grid_9">
diff --git a/data/xslt/indexes.xsl b/data/xslt/indexes.xsl
index 7ef0b4f..73a7048 100644
--- a/data/xslt/indexes.xsl
+++ b/data/xslt/indexes.xsl
@@ -400,29 +400,8 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
<xsl:if test="other-languages/lang">
<div class="other-languages">
- <h4>
- <xsl:call-template name="gettext"><xsl:with-param name="lang"
- select="$lang"/><xsl:with-param name="msgid"
- select="'langinfo'"/></xsl:call-template>
- </h4>
- <ul>
- <li class="active-language">
- <xsl:call-template name="language-label">
- <xsl:with-param name="lang" select="$lang"/>
- </xsl:call-template>
- </li>
- <xsl:for-each select="other-languages/lang">
- <li><a href="index.html.{node()}">
- <xsl:call-template name="language-label">
- <xsl:with-param name="lang" select="."/>
- </xsl:call-template>
- </a>
- <xsl:text> </xsl:text>
- <span class="lang-code">(<xsl:value-of select="."/>)</span>
- </li>
- </xsl:for-each>
- </ul>
- <script type="text/javascript" src="/js/language.js" />
+ <script type="text/javascript" src="/js/language.js" />
+ <script type="text/javascript">display_missing_translation_text()</script>
</div>
</xsl:if>
</div>
@@ -677,25 +656,6 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
</div>
</xsl:if>
- <h4>
- <xsl:call-template name="gettext"><xsl:with-param name="lang"
- select="@lang"/><xsl:with-param name="msgid"
- select="'langinfo'"/></xsl:call-template>
- </h4>
- <ul class="i18n">
- <xsl:for-each select="/indexes/index[ channel=$channel]">
- <xsl:sort select="@lang"/>
- <li><a href="{$filename} html { lang}">
- <xsl:call-template name="language-label">
- <xsl:with-param name="lang" select="@lang"/>
- </xsl:call-template>
- </a>
- <xsl:text> </xsl:text>
- <span class="lang-code">(<xsl:value-of select="@lang"/>)</span>
- </li>
- </xsl:for-each>
- </ul>
- <script type="text/javascript" src="/js/language.js" />
</div>
</div>
<xsl:call-template name="libgo.footer"/>
@@ -768,27 +728,6 @@ div.body-sidebar { width: 100%; }
</p>
</div>
</div>
- <div class="sidebar">
- <h4>
- <xsl:call-template name="gettext"><xsl:with-param name="lang"
- select="@lang"/><xsl:with-param name="msgid"
- select="'langinfo'"/></xsl:call-template>
- </h4>
- <ul class="i18n">
- <xsl:for-each select="//home">
- <xsl:sort select="@lang"/>
- <li><a href="index html { lang}">
- <xsl:call-template name="language-label">
- <xsl:with-param name="lang" select="@lang"/>
- </xsl:call-template>
- </a>
- <xsl:text> </xsl:text>
- <span class="lang-code">(<xsl:value-of select="@lang"/>)</span>
- </li>
- </xsl:for-each>
- </ul>
- <script type="text/javascript" src="/js/language.js" />
- </div>
</div>
<xsl:call-template name="libgo.footer"/>
</body>
@@ -833,6 +772,73 @@ div.body-sidebar { width: 100%; }
</xsl:template>
+ <xsl:template match="home" mode="languages">
+ <xsl:message>Writing languages.html.<xsl:value-of select="@lang"/></xsl:message>
+ <exsl:document href="languages html { lang}"
+ method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"
+ doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
+ <html lang="{ lang}">
+ <head>
+ <title>
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="lang" select="@lang"/>
+ <xsl:with-param name="msgid" select="'switchlang'"/>
+ </xsl:call-template>
+ â??
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="lang" select="@lang"/>
+ <xsl:with-param name="msgid" select="'sitetitle'"/>
+ </xsl:call-template>
+ </title>
+ <xsl:call-template name="libgo.head"/>
+ <script type="text/javascript" src="/js/strings.js" />
+ </head>
+ <body class="with-star">
+ <xsl:call-template name="libgo.header"/>
+ <div id="container" class="two_columns">
+ <div class="page_title"><h1 class="title">
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="lang" select="@lang"/>
+ <xsl:with-param name="msgid" select="'switchlang'"/>
+ </xsl:call-template>
+ </h1></div>
+ <div class="content">
+
+ <p>
+ <xsl:call-template name="gettext">
+ <xsl:with-param name="lang" select="@lang"/>
+ <xsl:with-param name="msgid" select="'activelang'"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="language-label">
+ <xsl:with-param name="lang" select="@lang"/>
+ </xsl:call-template>
+ </p>
+
+ <ul class="language-list">
+ <xsl:for-each select="//home">
+ <xsl:sort select="@lang"/>
+ <li><a href="index html { lang}"><xsl:call-template name="language-label">
+ <xsl:with-param name="lang" select="@lang"/>
+ </xsl:call-template></a>
+ <xsl:text> </xsl:text>
+ <span class="lang-code">(<xsl:value-of select="@lang"/>)</span>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </div>
+ <div class="sidebar">
+ <script type="text/javascript" src="/js/language.js" />
+ <script type="text/javascript">display_remove_cookie_text()</script>
+ </div>
+ </div>
+ <xsl:call-template name="libgo.footer"/>
+ </body>
+ </html>
+ </exsl:document>
+ </xsl:template>
+
<xsl:template match="indexes" mode="deprecated">
<xsl:message>Writing devel/deprecated.html</xsl:message>
<exsl:document href="devel/deprecated.html"
@@ -982,6 +988,7 @@ var remove_cookie_text = "<xsl:value-of select="$remove_cookie"/>";
</xsl:for-each>
<xsl:apply-templates select="." mode="nightly"/>
<xsl:apply-templates select="." mode="deprecated"/>
+ <xsl:apply-templates select="." mode="languages"/>
<xsl:apply-templates select="." mode="sitemap"/>
<xsl:apply-templates select="." mode="robotstxt"/>
<xsl:apply-templates select="home" mode="javascript"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]