Opened 17 months ago

Closed 16 months ago

Last modified 16 months ago

#19602 closed task (blessed) (fixed)

wptexturize() should have locale support

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

Description

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 16 months ago.
19602.2.diff (5.5 KB) - added by nacin 16 months ago.

Download all attachments as: .zip

Change History (8)

Related: #19550

nacin16 months 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).

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.

nacin16 months 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.

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.