Opened 2 years ago

Closed 2 years ago

#15798 closed defect (bug) (fixed)

The word „Comment“ is not translated in the dashboard

Reported by: settle Owned by:
Priority: normal Milestone: 3.1
Component: I18N Version: 3.1
Severity: minor Keywords: has-patch commit dev-reviewed
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 2 years ago.

Download all attachments as: .zip

Change History (9)

  • Component changed from General to I18N

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

nacin2 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' ).

  • Milestone changed from Awaiting Review to 3.1

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.

  • Keywords dev-reviewed added

Completely agree with your comment.

  • 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.