Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#15798 closed defect (bug) (fixed)

The word „Comment“ is not translated in the dashboard

Reported by: settle's profile 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 14 years ago.

Download all attachments as: .zip

Change History (9)

#1 @scribu
14 years ago

  • Component changed from General to I18N

#2 @SergeyBiryukov
14 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.

@nacin
14 years ago

#3 @nacin
14 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' ).

#4 @nacin
14 years ago

  • Milestone changed from Awaiting Review to 3.1

#5 @westi
14 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.

#6 @westi
14 years ago

  • Keywords dev-reviewed added

#7 @nacin
14 years ago

Completely agree with your comment.

#8 @nacin
14 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.