Re: How to display language flags using java?

Philippe Vollenweider <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Message-ID <[email protected]>
Hello,

You can get the flag like this:

String flagUrl = jData.params().getRequest().getContextPath() +
     "/jsp/jahia/engines/images/flags/" + languageCode + "_on.gif";

Cheers,

Philippe.

At 27.10.2004 17:03, you wrote:




>Hello all!
>I'm trying to change the behavior of language.jsp in the
>corporate_portal_templates to display using css instead of tables. I've
>changed the part that dealing with the table structure and it works fine.
>But then I want to output the actual flag and I tried something like this:
>
>     if (displayLink) {
>         l++;
>         displayTable = true;
>         if (l > 1){
>             sb.append("&nbsp;|&nbsp;");
>         }
>         Locale localeLangToDisplay =
>LanguageCodeConverters.languageCodeToLocale(languageCode);
>         String languageName =
>localeLangToDisplay.getDisplayLanguage(localeLangToDisplay) + " [" +
>localeLangToDisplay.getDisplayName() + "]";
>%>
>         <jahia:displayLanguageFlag  code="<%=languageCode%>"
>
>href='<%=currentLanguageCode.equals(languageCode) ? "" :
>jData.gui().drawPageLanguageSwitch(languageCode)%>'
>                                     alt="<%=languageName%>"/>
>     <%}
>
>}
>The jahia:displayLanguageFlag tag outputs html directly and the resulting
>html page snip then becomes
>
>         <a href="/jahia/Jahia/lang/en/pid/2"
>       onMouseOut="MM_swapImgRestore()"
>
>onMouseOver="MM_swapImage('flagImg90','','/jahia/jsp/jahia/engines/images/flags/en_on.gif',1)">
><img name="flagImg90" border="0" alt="English [engelska]"
>src="/jahia/jsp/jahia/engines/images/flags/en_off.gif"></a>
>     <div class="quicklink"></div>
>
>And what I want to do is to have the link inside the div tag.
>
>How can I get the html code for the flag to append to string buffer sb?
>I tried reading the org.jahia.taglibs.button.displayLanguageFlagTag java
>file but it doesn't seems like the easy way to go.
>
>Thanks,
>Christian

-------=[ pvollenweider at jahia dot com ]=---------
Jahia : A collaborative source CMS and Portal Server
www.jahia.org Community and product web site
www.jahia.com Commercial services company
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.