Display language labels on the edge of the sidebars

A few days ago, I asked this question about how to display language labels in an element view instead of its ISO version. How to apply them in the sidebars and in the search filters? I can not find xslt to generate the displayed values ​​on the sides of the sidebar.

Facade of the side panel of the language

In the image above, I would like to change the displayed values ​​to:

English (5325)
French (432)
Chinese (8)
Khmer (5)
Japanese (2)

And then, clicking, for example, the facade of the sidebar for French, the displayed value in the search filter should be Language Equals Frenchand does not look like the image below ( Language Equals fr):

enter image description here

Thanks in advance.

What i tried

I don't know if this is the most efficient way to do this, so any advice would be appreciated.

<xsl:template
        match="dri:list[@n='language']/dri:item/dri:xref/text()
        | dri:list[@id='aspect.discovery.SidebarFacetsTransformer.list.language']/dri:item/text()
        | dri:div[@id='aspect.discovery.SearchFacetFilter.div.browse-by-language-results']/dri:table/dri:row/dri:cell/dri:xref/text()">
            <xsl:apply-templates select="*[not(name()='head')]"/>
    <xsl:variable name="language">
        <xsl:value-of select="substring-before(.,' (')"/>
    </xsl:variable>
    <xsl:for-each select=".">
        <xsl:value-of select="concat(util:isoLanguageToDisplay($language),' (', substring-after(.,'('))"/>
    </xsl:for-each>
</xsl:template>

dc.language.iso , .

enter image description here

View More:

enter image description here

:

enter image description here

, .

+4

Source: https://habr.com/ru/post/1599786/


All Articles