[daisy] [JIRA] Commented: (DSY-327) daisy documentation: add language flags in the menu bar

Bruno Dumon (JIRA) issues at cocoondev.org
Wed Aug 23 10:53:08 CDT 2006


    [ http://issues.cocoondev.org//browse/DSY-327?page=comments#action_12874 ] 

Bruno Dumon commented on DSY-327:
---------------------------------

I've added the flags.

I've done it somewhat differently:
* added the flag stuff to documentlayout.xsl, so that the flags are displayed below the menu bar, since the menu bar is already pretty full (for me)
* I let it switch to the other language variant without switching the wiki's language, since I found this rather strange (might be just me)
* only show languages within current branch

I've also heard a comment that the english flag should preferably be a split USA/UK flag.

BTW, the file you supplied had spaces replaced by tabs and some changes in line endings which made comparing with the original impossible (not a big problem after all).

Here's the code I finally used (added at start of 'content' template in documentlayout.xsl):

<xsl:variable name="languageVariants" select="$pubdoc/d:availableVariants/d:availableVariant[@branchId = $pubdoc/@branchId]"/>
<xsl:if test="count($languageVariants) > 1">
  <div style="float: right">
    <xsl:for-each select="$languageVariants">
      <!-- sorting on language ID so that english comes before german -->
      <xsl:sort select="@languageId"/>
      <xsl:if test="@retired = 'false'">
        <xsl:if test="@liveVersionId != '-1' or ($isEditor and @liveVersionId = '-1')">
          <xsl:variable name="title">
            <xsl:choose>
              <xsl:when test="@languageName = 'de' ">German</xsl:when>
              <xsl:when test="@languageName = 'en' ">English</xsl:when>
              <xsl:when test="@languageName = 'default' ">English</xsl:when>
            </xsl:choose>
          </xsl:variable>
          <xsl:if test="$title != ''">
            <a href="{concat($documentPath, '.html?branch=', @branchName, '&amp;language=', @languageName)}" title="{$title}">
              <img src="{$mountPoint}/resources/local/flags/{@languageName}.gif" alt="{$title}"/>
            </a>
            <xsl:text>&#160;</xsl:text>
          </xsl:if>
        </xsl:if>
      </xsl:if>
    </xsl:for-each>
  </div>
</xsl:if>

> daisy documentation: add language flags in the menu bar
> -------------------------------------------------------
>
>          Key: DSY-327
>          URL: http://issues.cocoondev.org//browse/DSY-327
>      Project: Daisy
>         Type: Improvement
>     Versions: public - 2.0
>  Environment: N/A
>     Reporter: Andreas Deininger
>     Priority: Minor
>  Attachments: language_flags_menu_bar.tar.gz
>
> Were nice if language flags in the menu bar were added in the daisy documentation, so that readers immediately get aware of the existence of other language variants of the document.
> This issue was addressed in
> http://lists.cocoondev.org/pipermail/daisy/2006-August/004763.html
> Others seemed to like that idea, too.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list