How to display language flags using java?

[email protected]
Newsgroups gmane.comp.cms.jahia.template
Message-ID <OF3C51A76A.8FC95AE8-ONC1256F3A.0051C314-C1256F3A.0052BED9@generic.se>



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
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.