WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#15798 closed defect (bug) (fixed)

The word „Comment“ is not translated in the dashboard

Reported by: settle Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.1
Component: I18N Keywords: has-patch commit dev-reviewed
Focuses: Cc:

Description

I am translating Wordpress into lithuanian using Poedit. And I noticed that there is a conflict with plural form.

In the /wp-includes/theme-compat/comments-popup.php I found a line (56)

	<p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php printf(__('by %1$s &#8212; %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>

So I decided to change that line into

	<p><cite><?php comment_type(_x('Comment'), __('Trackback'), __('Pingback')); ?> <?php printf(__('by %1$s &#8212; %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>

_x('Comment') instead of __('Comment')

Now Poedit finds the plural form of „Comment“ and translates it in the Dashboard.
It works, but I don't know if it is a correct decision.

Attachments (1)

15798.diff (893 bytes) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 @scribu5 years ago

  • Component changed from General to I18N

comment:2 @SergeyBiryukov5 years ago

Don't you use .pot files for translation? They provide more accurate results when searching for new strings than updating from source files.

@nacin5 years ago

comment:3 @nacin5 years ago

  • Keywords has-patch commit added; Comment removed

I'm not sure if this fixes the bug here (I don't see a bug here) but we should simply call comment_type() without arguments. That way "Comment" is then translated like so: _x( 'Comment', 'noun' ).

comment:4 @nacin5 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:5 @westi5 years ago

I'm not a big fan of fixing the file in theme-compat because they were meant to be frozen in time.

But this looks like a sensible change to them as it is for I18N purposes only.

comment:6 @westi5 years ago

  • Keywords dev-reviewed added

comment:7 @nacin5 years ago

Completely agree with your comment.

comment:8 @nacin5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [17074]) Call comment_type() without arguments that way 'Comment' is translated internally with context. fixes #15798.

Note: See TracTickets for help on using tickets.