[Resolved] Backslash Showing in comment-metadata (WordPress Comments)

Home Forums Support Backslash Showing in comment-metadata (WordPress Comments)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #991117
    Marcus

    Hi!

    I’m using the Marketer Theme with WordPress running in Swedish language.
    Appears that my comments are showing the time, but a backslash is escaping(?) or something.

    See screenshot:
    Screenshot of the comments and inspect mode

    Is this a bug in Swedish translations or the theme?

    I assume “kl.” is used for shorting “klockan” (clock in Swedish)

    Would be appreciated if someone has a solution for this.

    Thanks a lot!
    /Marcus

    #991222
    Tom
    Lead Developer
    Lead Developer

    Hi Marcus,

    That’s strange – I just made the suggested change here:

    Not sure when that will be accepted, so we can try to use a function for now:

    add_filter( 'gettext', function( $text ) {
        if ( '%1$s \k\l\ %2$s' === $text ) {
            $text = '%1$s kl %2$s';
        }
    
        return $text;
    } );

    Let me know if that works or not 🙂

    #991324
    Marcus

    Hi Tom!
    Thanks for the quick response.

    I added it in the Snippets-plugin, but unfortunately it did not have any effect.

    Tried also adding the dot but didn’t change anything either (Acting like I know coding lol)

    #991726
    Tom
    Lead Developer
    Lead Developer

    Let’s try this:

    add_filter( 'gettext', function( $text ) {
        if ( '%1$s at %2$s' === $text ) {
            $text = '%1$s kl %2$s';
        }
    
        return $text;
    } );

    If that doesn’t work, you might need to edit the Swedish .po file in wp-content/languages/themes using a program like PoEdit: https://poedit.net/

    #991739
    Marcus

    Didn’t work unfortunately 🙁

    Thanks a lot for your help Tom, will translate it instead!

    #991742
    Marcus

    Fixed it easily through Loco Translate.

    No clue why the backslashes are there.
    Should just say “kl.”, “kl” or “klockan”

    Thanks for helping me out!

    #991748
    Tom
    Lead Developer
    Lead Developer

    Awesome!

    I’ve made the suggested edit to the translation – hopefully one of the editors approves it soon.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.