Announcement

Collapse
No announcement yet.

Add Unread Forum Badge

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I am still struggling with phrase use in css_additional.css.

    See post #19.

    I am trying to localize the unread badge via phrases, but unfortunately have no success.

    Can please someone help me to figure it out?

    I am using english and german language on the forum. German is actually the default language. The phrase vbmods_rocks_unreadforumbadge has been created in the AdminCP.

    Click image for larger version  Name:	image.png Views:	0 Size:	53.3 KB ID:	33641​
    The following has been added in css_additional.css.

    Code:
    /*************** Unread Forum Badge ***************/
    
    .forum-wrapper .unread ~ .forum-title::after {
        content: '{vb:phrase vbmods_rocks_newforumbadge}';
        background: red;
        color: #fff;
        font-size: 10px;
        font-weight: bold;
        padding: 1px 3px;
        border-radius: 3px;
        margin-left: 10px;
        filter: drop-shadow(1px 1px 2px #333);
        vertical-align: baseline;
        white-space: nowrap;
        text-decoration: none;
        display: inline;
    }
    
    .forum-list-container .forum-item .cell-forum .forum-title {
        margin-left: 0;
    }
    ​​
    The badge is always shown in the default language independently of which language is chosen on the page.

    Can this be fixed so that the appropriate phrase for the chosen language is used?

    Any idea?

    Help is greatly appreciated.​

    This problems exists also with other mods that use phrases in css_additional.css.

    Comment


      #32
      Are you caching template as files? Try turning it off and then on again.
      Buy me a coffeePayPal QR Code
      My Amazon Affiliate Link ​
      Fast vBulletin VPS Host:
      This site is hosted by IONOS

      Comment


      • flohse
        commented
        Editing a comment
        Tried it. Made no difference..

      #33
      flohse, I tried it and I was able to reproduce the issue. This seems like a vBulletin bug for CSS templates. When I tried using the phrase in a non-CSS template, it worked. So it looks like the issue is for CSS templates only.

      You can try this workaround solution to provide multiple translations in CSS templates:

      Default: (German)
      Code:
      .forum-wrapper .unread ~ .forum-title::after {
          content: 'Ungelesen';
          /* rest of the code here */
      }
      Then add this for English to override the German word:
      Code:
      html[lang="en"] .forum-wrapper .unread ~ .forum-title::after {
          content: 'Unread';
      }
      ​
      Buy me a coffeePayPal QR Code
      My Amazon Affiliate Link ​
      Fast vBulletin VPS Host:
      This site is hosted by IONOS

      Comment


      • flohse
        commented
        Editing a comment
        Workaround solution works great! Thanks! Enjoy your coffee!

    Latest Posts

    Collapse

    Working...
    X
    Searching...Please wait.
    An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

    Please push the back button and reload the previous window.'
    An unexpected error was returned: 'Your submission could not be processed because the token has expired.

    Please push the back button and reload the previous window.'
    An internal error has occurred and the module cannot be displayed.
    There are no results that meet this criteria.
    Search Result for "|||"