Opened 7 years ago

Closed 7 years ago

#2568 closed defect (bug) (fixed)

Translate meridiem in time

Reported by: Sewar Owned by: ryan
Priority: normal Milestone: 2.1
Component: General Version: 2.0.2
Severity: normal Keywords: bg|has-patch bg|needs-testing
Cc:

Description

This patches Translate meridiem in time.

I don't know if meridiem is good word for this thing, I just copied it from PHP's manual: date() function.

Attachments (7)

locale.php.diff (529 bytes) - added by Sewar 7 years ago.
functions.php.diff (2.9 KB) - added by Sewar 7 years ago.
wp_locale.diff (16.9 KB) - added by Sewar 7 years ago.
patch for WP_Locale class
wp_locale.3655.diff (18.2 KB) - added by Sewar 7 years ago.
match changes in [3654] and fix some errors in admin files.
admin-functions.php.diff (933 bytes) - added by Sewar 7 years ago.
Oops, I forget add admin-functions.php to patch, it contain patch for edit timestamp in post/page editing.
wp_locale.3659.diff (19.4 KB) - added by Sewar 7 years ago.
wp_locale.3664.diff (21.0 KB) - added by Sewar 7 years ago.

Download all attachments as: .zip

Change History (22)

Sewar7 years ago

Sewar7 years ago

  • Keywords bg|has-patch added

looks good to me.
+1

We could really do with wrapping all these localisation globals up into one associative array or class global. So e.g. instead of doing

global $meridiem, $weekday;
...
$meridiem
...
$weekday

we'd do

$global $wp_i10n;
...
$wp_i10n->meridiem
...
$wp_i10n->weekday

Sewar7 years ago

patch for WP_Locale class

  • Keywords bg|needs testing added

davidhouse: Good idea, i've create new patch.

Please test the new patch especially functions in "wp-includes/template-functions-general.php" because i haven't test most of them.

  • Keywords bg|needs-testing added; bg|needs testing removed

Wow, great job. I'll check it out. People should test this because I'm an english speaker and so am not too great at checking that localisation functions work :)

comment:6   ryan7 years ago

  • Owner changed from anonymous to ryan

Sewar7 years ago

match changes in [3654] and fix some errors in admin files.

davidhouse: I hope someone post it to wp-hackers and/or wp-polyglots mail lists.

wp_locale.3654.diff is updated version to match changes in [3654] and fix some errors in admin files.

Your patch looks great except for the fact that you removed the legacy variables. Put them back in and I think we're good to go.

Great job.

Sewar7 years ago

Oops, I forget add admin-functions.php to patch, it contain patch for edit timestamp in post/page editing.

  • Keywords bg|commit added

Isn't it is ready for commit?

  • Keywords bg|commit removed

Provide support for legacy and it is ready.

Sewar7 years ago

  • Keywords bg|commit added; bg|needs-testing removed

abhay: Sorry, i wasn't understand your first comment, i put them back.

Looks great

+1 to commit.

We could take it a step further and replace this:

$wp_locale->month[zeroise($arc_month, 2)]

with this:

$wp_locale->get_month($arc_month);

get_month() should handle doing the zeroise and fetching from the month array. Similarly for the rest of the locale data.

Sewar7 years ago

  • Keywords bg|needs-testing added; bg|commit removed

ryan: Good idea, test the new patch and if it's ready commit it.

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

(In [3676]) WP_Locale. Props Sewar. fixes #2568

Note: See TracTickets for help on using tickets.