Ticket #19602 (closed task (blessed): fixed)

Opened 2 months ago

Last modified 12 days ago

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

19602.diff Download (4.8 KB) - added by nacin 3 weeks ago.
19602.2.diff Download (5.5 KB) - added by nacin 3 weeks ago.

Change History

Related: #19550

nacin3 weeks 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.

nacin3 weeks ago

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

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.