WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#3224 closed defect (bug) (fixed)

wp-admin/upload-js.php uninternationalized

Reported by: nbachiyski Owned by: markjaquith
Milestone: 2.1 Priority: low
Severity: normal Version: 2.1
Component: Administration Keywords: has-patch 2nd-opinion
Focuses: Cc:

Description

Internationalized of this file is missing.
Patch attached.

Attachments (3)

i18n-upload-js.diff (8.9 KB) - added by nbachiyski 9 years ago.
3224.diff (3.7 KB) - added by mdawaffe 9 years ago.
3224b.diff (806 bytes) - added by mdawaffe 9 years ago.
"someone" = "mdawaffe"

Download all attachments as: .zip

Change History (12)

#1 @foolswisdom
9 years ago

  • Keywords has-patch added; bg|has-patch removed
  • Milestone set to 2.1
  • Version set to 2.1

#2 @markjaquith
9 years ago

  • Keywords 2nd-opinion added
  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

Is addslashes() the right thing to be using? Seems to me that single quotes need to be HTML entitized for HTML validation, and double quotes need to be HTML entitized for JS validation. Wouldn't wp_specialchars($string, true) be the way to go here?

#3 @ryan
9 years ago

Also, let's include raquo in the gettext.

#4 @ryan
9 years ago

Not sure whether wp_specialchars or js_escape is best here. Going with wp_specialchars for now.

#5 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4605]) upload-js gettext. Props nbachiyski. fixes #3224

#6 @mdawaffe
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

markaquith, it's more annoying than that. Sometiems JS interprets " as a real quote mark. It get's a little confusing.

js_escape() was born out of compromise, but it is asymmetric in single v. double quotes, so you still need to be careful. You definitely need to use js_escape() when there's a chance of \n appearing in the string.

Attached fixes some problems.

@mdawaffe
9 years ago

#7 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4611]) upload-js gettext fixes from mdawaffe. fixes #3224

#8 @Nazgul
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Someone killed a > too many in the second line af the last patch.

@mdawaffe
9 years ago

"someone" = "mdawaffe"

#9 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4613]) Typo fix. fixes #3224

Note: See TracTickets for help on using tickets.