WordPress.org

Make WordPress Core

#19601 closed task (blessed) (fixed)

Support localized defaults for options, dashboard widgets, etc.

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

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 17 months ago.
Localizes gmt_offset and timezone_string
19601.2.diff (1.1 KB) - added by nacin 17 months ago.

Download all attachments as: .zip

Change History (22)

comment:1 nacin17 months ago

In [19780]:

Offer start_of_week for translation. see #19601.

comment:2 nacin17 months 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.

comment:3 nacin17 months 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.

comment:4 nacin17 months ago

In [19781]:

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

comment:5 nacin17 months 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].

nacin17 months ago

Localizes gmt_offset and timezone_string

comment:6 nacin17 months 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.

comment:7 ryan17 months ago

19601.diff is fine by me.

comment:8 follow-up: nacin17 months 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.

comment:9 nacin17 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:10 nacin17 months ago

In [19786]:

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

comment:11 follow-up: SergeyBiryukov17 months 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

comment:12 in reply to: ↑ 8 Mamaduka17 months 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?

comment:13 nacin17 months ago

In [19788]:

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

comment:14 in reply to: ↑ 11 SergeyBiryukov17 months 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.

comment:15 nacin17 months ago

Broke out oEmbed into #19980.

nacin17 months ago

comment:16 nacin17 months 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.

comment:17 follow-up: kenan300817 months 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.

comment:18 in reply to: ↑ 17 nacin17 months 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.

comment:19 nacin14 months ago

  • Keywords has-patch commit added

comment:20 nacin14 months 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.