Making WordPress.org

Opened 8 years ago

Closed 8 years ago

#1903 closed defect (bug) (fixed)

Hardcoded strings in WordCamp.org plugin camptix-attendance

Reported by: kossmann's profile kossmann Owned by: iandunn's profile iandunn
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: has-patch
Cc:

Description

There are two hardcoded strings making it impossible to translate.

Attachments (4)

1903.diff (2.0 KB) - added by kossmann 8 years ago.
1903.2.diff (3.3 KB) - added by kossmann 8 years ago.
v2
1903.3.diff (3.3 KB) - added by kossmann 8 years ago.
v3
1903.4.diff (1.2 KB) - added by SergeyBiryukov 8 years ago.

Download all attachments as: .zip

Change History (16)

@kossmann
8 years ago

#1 @kossmann
8 years ago

  • Keywords has-patch added

#2 @iandunn
8 years ago

  • Owner set to kovshenin
  • Status changed from new to assigned

Hi Daniel, thanks for the patch!

This looks pretty good to me. The only minor things I'd change would be to use the wordcamporg text domain instead of camptix, and to always use the escaping translate functions (like esc_html__).

CampTix has it's own text domain because it's distributed in the WordPress.org repository, but the add-ons in the Meta repository should all use wordcamporg, so that they'll be included in our single GlotPress project.

Not everyone agrees with this, but personally I consider it a best practice to always use the escaping translate functions, to avoid any situations where malicious HTML is inserted into localized strings.

#3 @kossmann
8 years ago

Thanks for the feedback, here are the changes.

@kossmann
8 years ago

v2

#4 @kossmann
8 years ago

Hi, is everything OK with my changes? Should I do something else?

#5 @SergeyBiryukov
8 years ago

I think <strong>Note</strong>: Anyone with the secret link can access the attendance UI... should be a single string rather than two separate strings (Note: and Anyone with the secret link...).

Looks good to me otherwise.

@kossmann
8 years ago

v3

#6 @kossmann
8 years ago

Done!

#7 @iandunn
8 years ago

  • Owner changed from kovshenin to iandunn

It looks like Note isn't a separate string in 3.diff, but I can make that change when I commit it. The rest looks good to me.

#8 @iandunn
8 years ago

Er, nevermind, I misread Sergey's comment. 3.diff is correct.

#9 @SergeyBiryukov
8 years ago

1903.3.diff makes the whole string bold, I didn't mean that :)

I just meant the string can be wrapped with esc_html_e() as is, no need to separate it. Occasional HTML tags in translatable strings are fine, unless thay wrap the whole string or placeholders (e.g. <code>%s</code>), in which case they can be moved out of the string.

Last edited 8 years ago by SergeyBiryukov (previous) (diff)

#10 @iandunn
8 years ago

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

In 4968:

CampTix Attendance: Internationalize strings

Fixes #1903
Props kossmann, SergeyBiryukov

#11 @SergeyBiryukov
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to address comment:5 and comment:9 in 1903.4.diff.

Only the "Note" word should be bold, not the whole string. (Unless it was an intended change?)

#12 @coreymckrill
8 years ago

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

I think having the whole string bolded is ok. At this point if we change it back, the whole string will have to get translated again.

Note: See TracTickets for help on using tickets.