Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19602 closed task (blessed) (fixed)

wptexturize() should have locale support

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


The Hebrew translation of WordPress does not desire curly quotes. wptexturize() should not apply such transformations when it is not desirable for the locale.

This may necessitate in pulling in (and adding to) locales/locales.php from GlotPress.

Attachments (2)

19602.diff (4.8 KB) - added by nacin 4 years ago.
19602.2.diff (5.5 KB) - added by nacin 4 years ago.

Download all attachments as: .zip

Change History (8)

#1 @scribu
4 years ago

Related: #19550

4 years ago

#2 @nacin
4 years ago

  • Keywords has-patch added

Here's a rough-cut approach that internationalizes most entities in #19602: the apostrophe, prime (and double prime), and single curly quotes (to add to the existing i18n'd double quotes).

To disable curled quotes, a locale simply needs to translate each of these seven strings to either ' or ". A plugin can likewise hook into gettext_with_context and catch these six different $text values (apostrophe and closing single quote being the same entity for English).

#3 @nacin
4 years ago

We could check if each of these equal their straight equivalents before continuing with a replace, otherwise we're just doing needless regular expressions for a locale like he_IL.

4 years ago

#4 @nacin
4 years ago

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

In [19795]:

Allow the single quotes, apostrophes, and primes in wptexturize() to be translated. Allows replacements to be disabled by translating them back to " and '. fixes #19602.

#5 @nacin
4 years ago

In [19796]:

wptexturize() does not need to staticize variables it only uses to set up variables it needs statically. see #19602.

Note: See TracTickets for help on using tickets.