WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2143 closed defect (fixed)

Internationalize WordCamp Dashboard Widgets plugin

Reported by: iandunn Owned by: iandunn
Milestone: Priority: low
Component: WordCamp Site & Plugins Keywords: good-first-bug has-patch
Cc:

Description

The WordCamp Dashboard Widgets plugin needs to be internationalized.

The escaping translation functions (esc_html__(), esc_attr_e(), etc) should be used instead of their non-escaping counterparts.

Attachments (2)

2143.patch (7.0 KB) - added by chandrapatel 3 years ago.
2143.1.patch (7.6 KB) - added by chandrapatel 3 years ago.

Download all attachments as: .zip

Change History (10)

#1 @iandunn
3 years ago

  • Owner set to iandunn
  • Status changed from new to accepted

#2 @chandrapatel
3 years ago

Hi @iandunn

I will work on it.

@chandrapatel
3 years ago

#3 @chandrapatel
3 years ago

  • Keywords has-patch added; needs-patch removed

Hi @iandunn

I've submitted patch 2143.patch

Please check and let me know if it's fine.

#4 @coreymckrill
3 years ago

@chandrapatel Thanks for the patch! There are a few instances where the translation strings are not being escaped, probably because they contain HTML. In these cases, the strings should still be sanitized with wp_kses(). Something like this:

<?php 
printf( 
  wp_kses(
    __( 'Please send us <a href="%s">the "about" text and banner image</a> for your central.wordcamp.org page.', 'wordcamporg' ),
    array( 'a' => array( 'href' => true ) )
  ),
  'https://make.wordpress.org/community/handbook/wordcamp-organizer/first-steps/web-presence/your-page-on-central-wordcamp-org/'
); 
?> 

@chandrapatel
3 years ago

#5 @chandrapatel
3 years ago

Hi @coreymckrill

I've made changes as you suggested. See 2143.1.patch

Please check and let me know if its fine.

#6 @coreymckrill
3 years ago

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

In 4655:

WordCamp Dashboard Widgets: i18n for text strings

Fixes #2143
Props chandrapatel, coreymckrill

#7 @coreymckrill
3 years ago

@chandrapatel Thanks, and nice work!

A couple of suggestions for your next patch:

  • For PHP files, your indents should be with tab characters rather than spaces.
  • Keep the patch focused on the ticket issue. This patch had a couple of miscellaneous changes to comment punctuation and additional commas on array items. These aren't bad, but they distract from the important changes in the patch, so it's best to include them separately.

#8 @chandrapatel
3 years ago

Hi @coreymckrill

Sure, I will. Thanks for your suggestions.

Note: See TracTickets for help on using tickets.