Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problems with sprintf in translation

  • Avatar of Bloggsbe
    Bloggsbe
    Participant

    @bloggsbe

    Hi all, and congrats on the 1.0 milestone!

    I’ve translated the 1.0 into Norwegian, but I have a problem with translation of text that starts in the code with sprintf( __('%s created the group %s', 'buddypress'), $u.......

    That text is not translated. The translation is there (in the .mo file) and everything else is translated just fine.

    Does anyone have an idea on what’s going on?

    Regards,

    RuneG

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of Arturo
    Arturo
    Participant

    @arturo84

    i’m a member of BP Italy and i’ve translated the 1.0 pot file and all is ok the string “… %s created the group %s..” is translated… do you have used the .pot file in the 1.0 zip file?

    bp-groups.php line 1005, right?

    'content' => apply_filters( 'bp_groups_created_group_activity', sprintf( __('%s created the group %s', 'buddypress'), $user_link, '<a href="' . $group_link . '">' . $group->name . '</a>') . ' <span class="time-since">%s</span>', $user_link, $group_link, $group->name )

    As Arturo’s suggested, check you are working from the .pot file that comes with 1.0. It’s possible it was changed since an older version thus your translation not being applied.

    Avatar of Bloggsbe
    Bloggsbe
    Participant

    @bloggsbe

    @DJPaul

    Yes, that’s the one, and 1019, 1043 in the same file and everywhere there is sprintf ( __(.......

    And yes, it’s the .pot from the 1.0 zip.

    Regards,

    RuneG

    It looks like it *should* work. Guess we’ll have to wait to here from someone else who has done a translation if they get the problem.

    Avatar of Bloggsbe
    Bloggsbe
    Participant

    @bloggsbe

    Yea, I know. It _should_ work. But noooo :-)

    It’s probably an easy answer to it. I just don’t see it…

    Hope someone can give me some hints on what’s causing this. Thanks for your suggestions DJPaul and Arturo!

    Regards,

    RuneG

    Avatar of Bloggsbe
    Bloggsbe
    Participant

    @bloggsbe

    Ahhh, I found the error…

    Some of the things I\’ve done on my installation was done before I translated and uploaded the .mo file.

    When you do an activity, let\’s say you write on a group wire. The whole thing including the text wrote on the wire of the group is stored in the DB (in the table wp_bp_activity_sitewide), and thus if you change the language that will not change…

    But when you do something new, then the correct language is shown (and stored in the DB).

    So changing the language after you\’ve done something in your BuddyPress install is not a good idea :-)

    Regards,

    RuneG

    ;)

    Avatar of Ralev
    Ralev
    Participant

    @ralev

    I’m experiencing the same problem.

    It’s with a few strings that are translated in the PO file, but do not appear correct.

    “created the group”

    “updated the”

    “created a new blog:”

    “wrote a new blog post:”

    .. and may be more I can not catch at this moment.

    These strings are from the site-wire activity and appear in the INDEX , as well in other pages.. and.. they are pretty key to the user experience.. so it will be nice if there’s a solution on the horizon :)

    Avatar of Bloggsbe
    Bloggsbe
    Participant

    @bloggsbe

    The only solution as far as I know is to edit the DB via PHPMyAdmin (or something similar).

    I’ve also seen one more problem with the way BuddyPress stores the activity. If you edit, let’s say, a comment just after you’ve written it, it will show up as two comments in the same DB table, and thus show up two times in the wire widget. And three times if you edit it three times…

    I think it should be possible to edit the DB instead of inserting the same information several times.

    -

    RuneG

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.