Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6659 closed defect (bug) (fixed)

Update " (required)" sting in `bp_get_the_profile_field_required_label()`

Reported by: netweb's profile netweb Owned by: dcavins's profile dcavins
Milestone: 2.4 Priority: normal
Severity: normal Version:
Component: I18N Keywords: good-first-bug has-patch
Cc: dcavins

Description

Either 1) remove the leading whitespace character or 2) add a translator note

Source: https://buddypress.trac.wordpress.org/browser/trunk/src/bp-xprofile/bp-xprofile-template.php#L1339

String example for en-AU: https://translate.wordpress.org/projects/wp-plugins/buddypress/dev/en-au/default?filters[status]=either&filters[original_id]=14969&filters[translation_id]=2981007

1) Remove the leading space and merge the string with other ~25 instances of (required), see https://translate.wordpress.org/projects/wp-plugins/buddypress/dev/en-au/default?filters[status]=either&filters[original_id]=6279&filters[translation_id]=2980835

or

2) Add a translator note explaining the leading whitespace character as it would clarify why it exists without having to check the source code

Attachments (1)

6659.patch (723 bytes) - added by SergeyBiryukov 9 years ago.

Download all attachments as: .zip

Change History (10)

#1 @netweb
9 years ago

  • Keywords good-first-bug added

#2 @dcavins
9 years ago

  • Cc dcavins added
  • Owner set to dcavins
  • Status changed from new to accepted

Ha, I caused this problem. Is everyone ok with removing the line breaks from this code so that the space can live outside the translatable string? It'll ugly up the PHP a little, but make the result so much more reliable. @hnla?

#3 @DJPaul
9 years ago

Will that work with RTL CSS?

#4 @hnla
9 years ago

If it makes things more reliable, then we live with the space outside the translatable string, but we must have the space exist somewhere, problem can be that the space gets removed if not careful when it's sort of floating around :)

Pauls got a point though, how are these spaces handled by rtl layouts?

We could user :before/:after to add empty content string? But guessing janus wouldn't see ::before/::after as properties to be switched?

#5 follow-up: @dcavins
9 years ago

Wouldn't a space between text and a span just be handled inline with the text flow?
Or, is A long title <span>donkeys</span> a different case than A long title of horses?

In either case, moving the space outside the span versus leaving it in the span should be an equivalent case for RTL handling, shouldn't it?
Label<span> (required)</span> versus Label <span>(required)</span>

I'm speculating wildly, here.

@SergeyBiryukov
9 years ago

#6 in reply to: ↑ 5 @SergeyBiryukov
9 years ago

  • Keywords has-patch added; needs-patch removed

Replying to dcavins:

In either case, moving the space outside the span versus leaving it in the span should be an equivalent case for RTL handling, shouldn't it?
Label<span> (required)</span> versus Label <span>(required)</span>

Correct, removing the space from the translatable string and moving it out of the span is perfectly fine from RTL point of view. Text direction is still the same.

#7 @dcavins
9 years ago

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

In 10269:

Remove leading space from localizable string.

Move the space to the returned string, making the
translation string less fragile.

Props SergeyBiryukov.

Fixes #6659.

#8 @netweb
9 years ago

  • Milestone changed from Awaiting Review to 2.4

#9 @DJPaul
8 years ago

  • Component changed from Locale - i18n to I18N
Note: See TracTickets for help on using tickets.