Skip to:
Content

BuddyPress.org

Changeset 13420


Ignore:
Timestamp:
02/15/2023 09:22:13 AM (15 months ago)
Author:
imath
Message:

Edit translator comments of problematic strings

In 11.0 we have removed 1 placeholder to 2 strings used to display the
activity action for published posts. Issues were raised about the fact
some polyglots teams did not update corresponding translations leaving the
removed placeholder in their translated strings. As these two strings are
used inside sprintf() function it resulted in fatal errors for the
corresponding locales.

We hope simply improving the comment will avoid such mistakes raising
translators attention. The result of this commit should avoid the string
to be translated as long as the polyglots team haven't updated their
translations.

It is a temporary fix, the right one should be to create a "sanitization"
function wrapping sprintf() to make sure expected placeholders are found
into the translated strings.

Although we think this kind of function should be made available by
WordPress, in [https://core.trac.wordpress.org/ticket/55776#comment:3 this
ticket] the issue was diagnosed as invalid. It's probably ok when you have
a lot of polyglots contributors like WordPress has, it's a different
situation for plugins
: we will work on preventing these potential fatals
in the next major release (12.0).

Props 1benk1, webmasterfreya

Fixes #8821 (branch 11.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/11.0/src/bp-blogs/bp-blogs-activity.php

    r13342 r13420  
    223223        $action = sprintf(
    224224            /* translators: 1: the activity user link. 2: the blog link. */
    225             esc_html_x( '%1$s wrote a new post on the site %2$s', 'Multisite `new_blog_post` activity action', 'buddypress' ),
     225            esc_html_x( '%1$s wrote a new post on the site %2$s', 'Multisite `new_blog_post` activity action, since 11.0 only accepts two arguments', 'buddypress' ),
    226226            $user_link,
    227227            '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>'
     
    230230        $action = sprintf(
    231231            /* translators: 1: the activity user link. */
    232             esc_html_x( '%s wrote a new post', '`new_blog_post` activity action', 'buddypress' ),
     232            esc_html_x( '%s wrote a new post', '`new_blog_post` activity action, since 11.0 only accepts one argument', 'buddypress' ),
    233233            $user_link
    234234        );
Note: See TracChangeset for help on using the changeset viewer.