Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20481 closed defect (bug) (invalid)

Single quotes transformed to double quotes in post_content

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


When WPLANG is set to use certain non-English languages single quotes are converted to double quotes when displayed via the_content(). I think that the issue may have been introduced with [19795], but I am not certain about this. Here are steps to reproduce:

  • Export the Swedish .mo file from GlotPress and save it to wp-content/languages as sv_FI.mo.
  • Set define ('WPLANG', 'sv_FI' ); in wp-config.php.
  • Create a new post using the content from the attached test data (quotes-test-data.txt).
  • Publish the post and view in the the theme.

At this point you should notice that many of the single quotes have been converted to double.

I've only observed this when WordPress uses the Swedish .mo files. I have not tested in any other non-English languages. English does not appear to be affected.

Attachments (1)

quotes-test-data.txt (801 bytes) - added by mfields 4 years ago.

Download all attachments as: .zip

Change History (4)

#1 @yoavf
4 years ago

I think this is probably because the single quote is translated into a double quote in the translation itself:

Version 0, edited 4 years ago by yoavf (next)

#2 @nacin
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is probably intentional. The sv_FI translators have deliberately translated ‘ and ’ to the double quotes.



Some languages may do this as they only have one kind of quote. (We differentiate single closing quotes from apostrophes in wptexturize, so they may — and do — translate that differently.)

If it is not intentional, then the translators can simply fix the string. You can let them know by posting to wppolyglots or using the contact form on sv.wordpress.org. This is not an issue with core.

#3 @mfields
4 years ago

Thanks for the feedback and sorry for the false alarm.

Note: See TracTickets for help on using tickets.