Re: Re: Full language names in #metanavi?

Simon Rönnqvist <[email protected]> Thu, 28 Sep 2006 22:08:25 +0300
Newsgroups gmane.comp.cms.bitflux.general
Message-ID <1159470505.5762.636.camel@dedaa>
  Hi!

After looking through everything carefully over and over again, I
figured that I'll have to find a workaround. As a matter of fact, the
page I'm making may be really good with flags in the language selection
too.

That would could be done with a metanavi like this one:
                        <div id="metanavi">
                                <xsl:for-each select="$langsAvail/langs/entry[not(.=$lang)]">
                                <xsl:choose>
                                    <xsl:when test="text() = $defaultLanguage">
                                    <a href="{concat($webrootW,$collectionUri)}">
                                       <img src="{$webroot}themes/{$theme}/images/flag_{.}.png" alt="{.}" class="flag" />
                                    </a>
                                    </xsl:when>
                                    <xsl:otherwise>
                                    <a href="{concat($webroot,.,$collectionUri)}">
                                       <img src="{$webroot}themes/{$theme}/images/flag_{.}.png" alt="{.}" class="flag" />
                                    </a>
                                    </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:for-each>
                          
 	                       </div>

But I think I'll go with a more CSS-friendly and flexible way, as the
CSS-geek I am. :-)

			<ul id="metanavi">
                                <xsl:for-each select="$langsAvail/langs/entry[not(.=$lang)]">
                                <li><xsl:choose>
                                    <xsl:when test="text() = $defaultLanguage">
                                    <a href="{concat($webrootW,$collectionUri)}" id="{.}">
                                     <xsl:value-of select="."/>
                                    </a>
                                    </xsl:when>
                                    <xsl:otherwise>
                                    <a href="{concat($webroot,.,$collectionUri)}" id="{.}">
                                      <xsl:value-of select="."/>
                                    </a>
                                    </xsl:otherwise>
                                    </xsl:choose></li>
                                </xsl:for-each>
                          </ul>

This gives me a bit more flexibility for CSS-magic. :-) But most
probably I'll just put flags using image replacements (ie. indenting the
text out of screen having only the background image show up). So it'll
get a bit more complicated, but gives more flexibility for people loving
CSS... one might also consider this latter one a bit more politically
correct. :-)

  cheers, Simon


On Tue, 2006-09-26 at 18:57 +0300, Simon Rönnqvist wrote:
> On Thu, 2006-07-27 at 11:39 +0200, Christian Stocker wrote:
> > 
> > On 27.7.2006 0:03 Uhr, Simon Rönnqvist wrote:
> > > On Tue, 2006-07-25 at 07:36 +0200, Christian Stocker wrote:
> > >> What happens then? No output at all? Or still just sv,en,fi?
> > >> Does it go into that loop?
> > > 
> > >   Just sv, en, fi, so I guess that means that it goes into the loop...
> > 
> > <i18n:text><xsl:value-of select="."/></i18n:text>
> > 
> > Works for me :)
> > 
> > is the i18n prefix defined in your master.xsl? Like
> > 
> >     xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
> > 
> > chregu
> 
> 
>   Hi!
> 
> I got back to this problem again... (See archive if you don't
> rememeber.) No matter how I try to change the default metanavi's en, de,
> whatever to ie. "English", "Deutsch", whatever... nothing happends. Any
> ideas?
> 
> I've got the link in all of my master_??.xml to master.xml, the
> 'translations' in master.xml and the namespace for i18n in master.xsl as
> well as the <i18n:text> around the langlink texts that I'd like to
> change. The only thing that I can see is differing from what you
> suggested is that I've made my metanavi an unordered list. But I also
> tried experimenting by putting <i18n:text>fi</i18n:text> somewhere else
> in the template, and that didn't work.
> 
>   cheers, Simon
> 
> 
> PS. Here's my metanavi:
>                         <ul id="metanavi">
>                                 <xsl:for-each select="$langsAvail/langs/entry[not(.=$lang)]">
>                                 <li><xsl:choose>
>                                     <xsl:when test="text() = $defaultLanguage">
>                                     <a href="{concat($webrootW,$collectionUri)}">
>                                      <i18n:text><xsl:value-of select="."/></i18n:text>
>                                     </a>
>                                     </xsl:when>
>                                     <xsl:otherwise>
>                                     <a href="{concat($webroot,.,$collectionUri)}">
>                                       <i18n:text><xsl:value-of select="."/></i18n:text>
>                                     </a>
>                                     </xsl:otherwise>
>                                     </xsl:choose></li>
>                                 </xsl:for-each>
>                           </ul>
> 
> 

-- 
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms