WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#19601 closed task (blessed) (fixed)

Support localized defaults for options, dashboard widgets, etc.

Reported by: nacin Owned by: nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch commit
Focuses: Cc:
PR Number:

Description

A number of locales provide defaults for various aspects of core:

  • Options such as rss_language, gmt_offset or default timezone, start_of_week.
  • Some provide a local pinging site; others, a local oEmbed site.
  • Some change the dashboard widgets to pull from a local WordPress planet or the localized news blog.
  • Some modify the default Links (wp_links) to point to localized resources.

Core should maintain support for these, across all locales, acting on the advice of the translation teams. Essentially, it should work out of the box.

This may result in us pulling in locales/locales.php from GlotPress. See #19600.

Attachments (2)

19601.diff (1.3 KB) - added by nacin 8 years ago.
Localizes gmt_offset and timezone_string
19601.2.diff (1.1 KB) - added by nacin 8 years ago.

Download all attachments as: .zip

Change History (22)

#1 @nacin
8 years ago

In [19780]:

Offer start_of_week for translation. see #19601.

#2 @nacin
8 years ago

I think with [19780], we should break from ISO 8601 (not to mention Europe) and set the default start of week to Sunday, for us U.S. types. After all, we are en_US by default.

#3 @nacin
8 years ago

After looking into the history of rss_language (including #5517 and #6854), I was baffled it's been a problem for this long. It should have died a long time ago. I've moved #13440 to 3.4 and will handle it there.

#4 @nacin
8 years ago

In [19781]:

Offer default links and applicable URLs for translation. Some of these are already translatable elsewhere. see #19601.

#5 @nacin
8 years ago

Some change the dashboard widgets to pull from a local WordPress planet or the localized news blog.

Never mind, these are already translatable, and mostly share the same strings for both URLs and titles with [19781].

@nacin
8 years ago

Localizes gmt_offset and timezone_string

#6 @nacin
8 years ago

19601.diff attempts to localize gmt_offset and timezone_string.

Unfortunately, our changes back in 2.9 to always set UTC means that date('Z') / 3600 will always return 0. (Some commentary in #10940 and elsewhere.) In fairness, server time is not particularly effective for determining timezones, so I don't think it is worth a hack to store the initial timezone string before loading the bootstrap, as I first considered. (This isn't the only dead code in upgrade.php that tries in vain to get the server's offset, only to do math with a bunch of zeroes.)

We should go forward with this patch, and try to work in client detection of timezones to benefit all users, such as #10660.

#7 @ryan
8 years ago

19601.diff is fine by me.

#8 follow-up: @nacin
8 years ago

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

In [19785]:

Allow translators to specify a default timezone string OR GMT offset. Stop doing date('Z')/3600 math for default gmt_offset, as since WP 2.9, we set server time to UTC. Server time is unreliable, so no workarounds for now. fixes #19601.

#9 @nacin
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Not fixed yet. Still need to look into local ping and oEmbed sites.

#10 @nacin
8 years ago

In [19786]:

Switch to Feedback, from Suggest Ideas, for a default link, based on 3.3 toolbar. see #19601.

#11 follow-up: @SergeyBiryukov
8 years ago

Only two locales seem to have additional pinging/oEmbed sites.

bg_BG adds Vbox7.com and TopBlogLog.com:
http://i18n.trac.wordpress.org/browser/bg_BG/tags/3.2/dist/wp-content/languages/bg_BG.php

zh_CN adds Youku.com, 56.com and Tudou.com, with an option to disable:
http://i18n.trac.wordpress.org/browser/zh_CN/tags/3.3.1/dist/wp-content/languages/zh_CN.php#L292

#12 in reply to: ↑ 8 @Mamaduka
8 years ago

Replying to nacin:

In [19785]:

Allow translators to specify a default timezone string OR GMT offset. Stop doing date('Z')/3600 math for default gmt_offset, as since WP 2.9, we set server time to UTC. Server time is unreliable, so no workarounds for now. fixes #19601.

Shouldn't you use _x() instead of __(), cause we got context?

#13 @nacin
8 years ago

In [19788]:

Use the _x context function. props Mamaduka. see #19601.

#14 in reply to: ↑ 11 @SergeyBiryukov
8 years ago

Replying to SergeyBiryukov:

Only two locales seem to have additional pinging/oEmbed sites.

Now that I think of it, I'd probably add a couple of services for ru_RU as well.

#15 @nacin
8 years ago

Broke out oEmbed into #19980.

@nacin
8 years ago

#16 @nacin
8 years ago

19601.2.diff breaks out ping_sites into a translated string.

The other option is to actually send the blog's locale to Ping-O-Matic, and maintain the local list there. I like the idea, but it's also a decent amount of work. Will see what Matt thinks.

#17 follow-up: @kenan3008
8 years ago

@nacin Strings for start_of_week and timezone_string/gmt_offset (schema.php line 359 and 373) are not in POT files for translate.wordpress.org and it is not possible to translate them at the moment. Strangely enough, they are listed in the POT file for wp.com.

#18 in reply to: ↑ 17 @nacin
8 years ago

Replying to kenan3008:

@nacin Strings for start_of_week and timezone_string/gmt_offset (schema.php line 359 and 373) are not in POT files for translate.wordpress.org and it is not possible to translate them at the moment. Strangely enough, they are listed in the POT file for wp.com.

Our pot generator needed a kickstart. Fixed.

#19 @nacin
8 years ago

  • Keywords has-patch commit added

#20 @nacin
8 years ago

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

Not dealing with ping sites for 3.4. Can revisit for 3.5. The only distribution that used it, bg_BG, has yet to be updated past 3.2.1.

Note: See TracTickets for help on using tickets.