text based language menu via Typoscript

I want to click on the text “English” to get the english version of the website. Before I had a graphical menu:

lib.tslangmenu = HMENU
lib.tslangmenu {
  special = language
  special.value = 0,1,2
  addQueryString = 1
  1 = GMENU
  1.NO {
    XY = 24,16
    5 = IMAGE
    5.file = fileadmin/templates/images/deutsch.jpg || fileadmin/templates/images/englisch.jpg || fileadmin/templates/images/kroatisch.jpg
  }

  1.ACT < 1.NO
  1.ACT = 1
  1.ACT.wrap = <span class="langhide"> | </span>

  1.CUR < 1.ACT
  1.CUR = 1
}

This worked so far. Now I should change the menu to a text-based menu.

lib.tslangmenu {
  special = language
  special.value = 0,1,2
  special.normalWhenNoLanguage = 0
  addQueryString = 1
  1 = TMENU
  1.NO = 1
  1.NO.stdWrap.override = Deutsch || English || Hrvatski

  1.ACT < 1.NO
  1.ACT = 1
  1.ACT.stdWrap = <span class="langhide"> | </span>

  1.CUR < 1.ACT
  1.CUR = 1
}

Now the wrap with the span is completely ignored. Also the menu is now displayed as follows:

MyCurrentPageName English Hrvatski

If I’m on german the word deutsch is overwritten with the current page title. The same is valid for all other languages. I also tried the TS given in this blog article. But currently it does the same. How do I get this working?

Answers

The first error is in your wrap: NO is not wrapped, so no span is generated (for NO-items). The problem that the page title is shown comes from wrong copying. The line

1.ACT < 1.NO

should really be

1.ACT < .1.NO

Just in case, here is a TS-config I have in active use:

lib.languageMenu = HMENU
lib.languageMenu {
  special = language
  special.value = 0,1

  1 = TMENU
  1 {
    wrap = <ul class="langMenu">|</ul>
    noBlur = 1
    NO = 1
    NO {
      linkWrap = <li class="menu-item normal">|</li>

      stdWrap.override = English || Deutsch
      stdWrap.htmlSpecialChars = 1
    }

    ACT < .NO
    ACT {
      doNotLinkIt = 1
      linkWrap = <li class="menu-item active">|</li>
    }

    # NO + Translation doesn't exist
    USERDEF1 < .NO
    USERDEF1.doNotLinkIt = 1

    # ACT + Translation doesn't exist
    USERDEF2 < .ACT
    USERDEF2.doNotLinkIt = 1
  }
}

Regards,
Jost