Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#19600 closed task (blessed) (fixed)

Core should know which locales are RTL

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

Currently an RTL locale needs to specify $text_direction = 'rtl'; in a $locale.php file. In the interest of eliminating the need for $locale.php files, core should keep a list of RTL locales.

$text_direction would remain functional, and we're not killing $locale.php -- just trying to cover its primary uses.

While a simple array of RTL locales can be maintained now, there might reach a point where it will be easier to include locales/locales.php in core. (Indeed, mu_dropdown_languages() would benefit from this.) In that case, RTL could be read from there.

Attachments (1)

19600.patch (484 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
13 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
13 years ago

The patch adds the locales which currently set text_direction in $locale.php.

There are some more (seemingly unmaintained) locales in GlotPress marked as RTL: dv, fa_AF, ha, ps, uz_UZ, yi.

ckb and ug_CN are not marked as RTL in GlotPress, but still set text_direction in $locale.php.

#3 @nacin
13 years ago

In [19754]:

Remove locale_vars from WP_Locale. Explicitly set the text_direction property from a global, not from an arbitrary list. see #19600.

#4 @nacin
13 years ago

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

In [19755]:

Initial support for RTL detection in core. props SergeyBiryukov for compiling the list. fixes #19600.

#5 @nacin
13 years ago

I have a strong feeling that [19755] will evolve more as 3.4 continues. We'll work with this for now.

#6 @nacin
13 years ago

In [19761]:

Docs for WP_Locale::is_locale_rtl( $locale ). see #18180, see #19600.

#25 @nacin
13 years ago

In [19836]:

Do RTL detection based on a translated string, rather than a hardcoded list. Makes things a bit cleaner. fixes #19924, fixes #19600.

Note: See TracTickets for help on using tickets.