WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 2 years ago

#2571 closed defect (fixed)

Remove tabs and newlines from internationalized strings

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

Description

As I was sharing the new WordCamp Bern page I got the feedback that people were more likely to overlook the subscribe box and instead fill out the contact form at the bottom.

https://2017.bern.wordcamp.org/

This got me thinking what the arrows were supposed to mean and realized that they were tabs from the translation.

<?php printf(
                // translators: %s is the name of the blog
                __(
                        '%s is in the early planning stages.
                        In the meantime, you can subscribe to be notified when the site goes live, or contact the organizers to get involved.',
                        'wordcamporg'
                ),
                esc_html( get_bloginfo( 'name' ) )
); ?>

Better maybe to split up the strings and mention where the items are on the page. I have added "above" and "below" to the string.

<?php printf(
                // translators: %s is the name of the blog
                __(
                        '%s is in the early planning stages..',
                        'wordcamporg'
                ),
                esc_html( get_bloginfo( 'name' ) )
);
_e(
        'In the meantime, you can subscribe to updates above, or contact the organizers below to get involved.',
        'wordcamporg'
),?>

https://meta.svn.wordpress.org/sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/views/template-coming-soon.php

Attachments (4)

2571.PNG (40.5 KB) - added by SergeyBiryukov 3 years ago.
2571.patch (970 bytes) - added by SergeyBiryukov 3 years ago.
2571.2.patch (954 bytes) - added by SergeyBiryukov 3 years ago.
2571.3.patch (20.1 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (18)

#1 @iandunn
3 years ago

The line breaks are there in the code for readability, but IIRC the i18n guidelines are to keep entire paragraphs as a single string, rather than breaking them up into multiple strings.

I would assume that the arrows are something that the translator accidentally added. Maybe GlotPress should be stripping them out automatically?

cc @ocean90 for a second opinion.

#2 @ocean90
3 years ago

The line breaks are there in the code for readability,

Line breaks are usually okay but tabs shouldn't be included in strings like in this case.

Maybe GlotPress should be stripping them out automatically?

This was fixed in 2.2: https://github.com/GlotPress/GlotPress-WP/issues/473

#3 @iandunn
3 years ago

Removing the tabs would be worse for readability than removing the newlines, so I'd prefer to do the latter if we have to.

It sounds like the localized strings can be fixed by just re-saving them in GlotPress, though; is that right?

@SergeyBiryukov
3 years ago

@SergeyBiryukov
3 years ago

#5 @SergeyBiryukov
3 years ago

  • Keywords has-patch added

This is how the current string looks in GlotPress: 2571.PNG.

It doesn't seem like the line break improves the readability that much, I'd suggest removing it.

#6 @grapplerulrich
3 years ago

As we are making a change can we change the text to:

%s is in the early planning stages. In the meantime, you can subscribe to updates above, or contact the organizers below to get involved.

#7 @SergeyBiryukov
3 years ago

Updated the patch with the text proposed in comment:6.

#8 @iandunn
3 years ago

  • Owner set to iandunn
  • Priority changed from normal to low
  • Status changed from new to accepted
  • Summary changed from Improving coming soon text to Remove newlines from internationalized strings

2571.2.patch looks good to me.

Since the underlying issue is bigger than just this one string, I renamed the ticket to widen the focus, and it can remain open until they're all fixed.

Individual patches can of course be committed in the meantime. I added 2571.2.patch to my list, but if anyone else has time before I get to it, feel free.

#9 @coreymckrill
2 years ago

In 5534:

WordCamp Coming Soon: Remove whitespace chars from translation string

Remove tab characters to fix rendering of translated string. Remove
newline characters to follow i18n guidelines.

Props SergeyBiryukov
Refs #2571

#10 @coreymckrill
2 years ago

  • Summary changed from Remove newlines from internationalized strings to Remove tabs and newlines from internationalized strings

#11 @coreymckrill
2 years ago

  • Keywords needs-patch good-first-bug added; has-patch removed

#12 @SergeyBiryukov
2 years ago

  • Keywords has-patch added; needs-patch removed

@coreymckrill In 2571.3.patch:

  • Fix the issue for the remaining WordCamp.org strings.
  • Add translator comments for placeholders in the edited strings.
  • Remove some unnecessary HTML from the edited strings.

This ticket was mentioned in Slack in #meta-wordcamp by coreymckrill. View the logs.


2 years ago

#14 @coreymckrill
2 years ago

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

In 5819:

WordCamp: Remove tabs and newlines from internationalized strings

  • Fix the issue for the remaining WordCamp.org strings.
  • Add translator comments for placeholders in the edited strings.
  • Remove some unnecessary HTML from the edited strings.

Fixes #2571
Props SergeyBiryukov

Note: See TracTickets for help on using tickets.