Site logo

Archived topic

Backslash Showing in comment-metadata (Wordpress Comments)

6 replies · Started by Marcus Lindblad on August 22, 2019

Viewing posts 1–7 of 7

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

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 :)

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)

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/

Didn't work unfortunately :(

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

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!

Awesome!

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

This archived topic is closed to new replies.