Skip to:
Content

BuddyPress.org

Changeset 13419


Ignore:
Timestamp:
02/15/2023 09:11:48 AM (20 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

See #8821 (trunk)
Closes https://github.com/buddypress/buddypress/pull/66

File:
1 edited

Legend:

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

    r13405 r13419  
    221221        $action = sprintf(
    222222            /* translators: 1: the activity user link. 2: the blog link. */
    223             esc_html_x( '%1$s wrote a new post on the site %2$s', 'Multisite `new_blog_post` activity action', 'buddypress' ),
     223            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' ),
    224224            $user_link,
    225225            '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>'
     
    228228        $action = sprintf(
    229229            /* translators: 1: the activity user link. */
    230             esc_html_x( '%s wrote a new post', '`new_blog_post` activity action', 'buddypress' ),
     230            esc_html_x( '%s wrote a new post', '`new_blog_post` activity action, since 11.0 only accepts one argument', 'buddypress' ),
    231231            $user_link
    232232        );
Note: See TracChangeset for help on using the changeset viewer.