Ticket #19601 (reopened task (blessed))

Opened 2 months ago

Last modified 13 days ago

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:
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

19601.diff Download (1.3 KB) - added by nacin 4 weeks ago.
Localizes gmt_offset and timezone_string
19601.2.diff Download (1.1 KB) - added by nacin 2 weeks ago.

Change History

In [19780]:

Offer start_of_week for translation. see #19601.

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.

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.

In [19781]:

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

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].

nacin4 weeks ago

Localizes gmt_offset and timezone_string

19601.diff Download 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   ryan3 weeks ago

19601.diff is fine by me.

comment:8 follow-up: ↓ 12   nacin3 weeks ago

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

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.

  • Status changed from closed to reopened
  • Resolution fixed deleted

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

In [19786]:

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

comment:11 follow-up: ↓ 14   SergeyBiryukov3 weeks 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   Mamaduka3 weeks 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?

In [19788]:

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

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

Broke out oEmbed into #19980.

nacin2 weeks ago

19601.2.diff Download 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: ↓ 18   kenan30082 weeks 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   nacin13 days 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.

Note: See TracTickets for help on using tickets.