Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#3863 closed defect (bug) (fixed)

i18n fixes

Reported by: yskin Owned by: rob1n
Milestone: 2.2 Priority: low
Severity: normal Version: 2.1.1
Component: I18N Keywords: has-patch commit
Focuses: Cc:


Line 104 in wp-admin/edit.php

echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";

In english, people often use "May 2006", but in some other languages, people use "2006-05".

Line 180 in wp-admin/edit.php,

the_time(_('Y-m-d \<\b\r \/\> g:i:s a'));

Why only one underscore?

Line 156 in wp-admin/edit-comments.php, and line 124 in wp-admin/moderation.php

comment_date('M j, g:i A');

'M j, g:i A' should be i18ned.

Attachments (2)

3863.diff (2.6 KB) - added by rob1n 9 years ago.
3863.2.diff (2.3 KB) - added by rob1n 9 years ago.

Download all attachments as: .zip

Change History (9)

#1 @rob1n
9 years ago

  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

9 years ago

#2 @rob1n
9 years ago

  • Keywords has-patch commit added

#3 @rob1n
9 years ago

  • Milestone changed from 2.1.2 to 2.2

#4 @ryan
9 years ago

__($wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear");

That won't work. Only literal strings can be marked for translation with () and _e().

9 years ago

#5 @yskin
9 years ago

Line 343 in wp-includes/general-template.php is

$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);

So I traslate '%1$s %2$d' to '%2$d-%1$s' in simplified chinese po file.

What about replace line 104 in wp-admin/edit.php to

printf(__('%1$s %2$d'), $wp_locale->get_month($arc_row->mmonth), $arc_row->yyear);

, rob1n?

#6 @ryan
9 years ago

'%1$s %2$d' has little context, making it hard to translate especially when it starts occurring in multiple places. We need to add context support to properly translate these, which means getting #3687 in.

#7 @ryan
9 years ago

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

(In [4974]) gettext date formats. Props rob1n and yskin. fixes #3863

Note: See TracTickets for help on using tickets.