Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#17777 closed enhancement (fixed)

Simplifying some Twenty-Eleven strings for i18n

Reported by: xibe's profile xibe Owned by: nbachiyski's profile nbachiyski
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.2
Component: Bundled Theme Keywords: has-patch dev-feedback commit
Focuses: Cc:

Description

Is there a way the following strings could be made simpler, so that translators wouldn't have to waddle through the attributes in order to find the hidden word(s) to translate? It could even prevent mistakes (wrongly deleted <'s and such).

content-image.php:34

<a href=\"%1$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%2$s\" pubdate>%3$s</time></a><span class=\"by-author\"> <span class=\"sep\"> by </span> <span class=\"author vcard\"><a class=\"url fn n\" href=\"%4$s\" title=\"%5$s\" rel=\"author\">%6$s</a></span></span>

image.php:29

<span class=\"meta-prep meta-prep-entry-date\">Published </span> <span class=\"entry-date\"><abbr class=\"published\" title=\"%1$s\">%2$s</abbr></span> at <a href=\"%3$s\" title=\"Link to full-size image\">%4$s &times; %5$s</a> in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%7$s</a>

functions.php:556

<span class=\"sep\">Posted on </span><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\" pubdate>%4$s</time></a><span class=\"by-author\"> <span class=\"sep\"> by </span> <span class=\"author vcard\"><a class=\"url fn n\" href=\"%5$s\" title=\"%6$s\" rel=\"author\">%7$s</a></span></span>

---

Not as confusing, but still could gain from simplification:

content.php:30 and others...

<span class=\"leave-reply\">Reply</span>

content.php:77 and others...

<span class=\"leave-reply\">Leave a reply</span>

---

As a final bonus, this one could use some 'splaining :)

functions.php:56

%1$s on %2$s%3$s at %4$s%5$s <span class=\"says\">said:</span>

Attachments (1)

2011-i18n-reply.diff (12.2 KB) - added by nbachiyski 14 years ago.

Download all attachments as: .zip

Change History (26)

#1 @vanillalounge
14 years ago

  • Cc jfontainhas@… added

#2 @dd32
14 years ago

  • Component changed from Themes to Bundled Theme
  • Milestone changed from Awaiting Review to 3.2
  • Summary changed from Simplifying some Twenty-Ten strings for i18n to Simplifying some Twenty-Eleven strings for i18n

Moving into 3.2 for review

Strings which are simply <tag>Word</tag> can probably be moved to just Word depending on the context they're used in in the theme.

Another 2 strings I saw on a quick scan of the pot:

#: inc/theme-options.php:98
msgid ""
"<a href=\"http://codex.wordpress.org/Appearance_Theme_Options_Screen\" "
"target=\"_blank\">Documentation on Theme Options</a>"
msgstr ""

#: inc/theme-options.php:99
msgid ""
"<a href=\"http://wordpress.org/support/\" target=\"_blank\">Support Forums</"
"a>"
msgstr ""

Elsewhere we translate the url seperate from the text.

Someone else with internationalisation knowledge will have to weigh in on these though (ie. not me)

#3 follow-up: @xibe
14 years ago

Thanks Dion.

As an added notice to the final bonus (wew!), please have potbot/makebot devs have a look at this issue, for which I couldn't find a proper Trac to categorize in (since it doesn't pertain to the WP code itself). If "I18N" is enough of a component for this, let me know, I'll create the Trac ticket accordingly.

#4 @pavelevap
14 years ago

  • Cc pavelevap@… added

#5 in reply to: ↑ 3 @nbachiyski
14 years ago

Replying to xibe:

As an added notice to the final bonus (wew!), please have potbot/makebot devs have a look at this issue, for which I couldn't find a proper Trac to categorize in (since it doesn't pertain to the WP code itself). If "I18N" is enough of a component for this, let me know, I'll create the Trac ticket accordingly.

For the sake of completeness – the problem described there was fixed.

#6 @nbachiyski
14 years ago

In [18303]:

Split the comment date and time string into two and add translator comments. See #17777

#7 @nbachiyski
14 years ago

In [18304]:

Add forgotten spaces. See #17777

#8 @nbachiyski
14 years ago

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

#9 follow-up: @dd32
14 years ago

<span class=\"leave-reply\">Reply</span> and <span class=\"leave-reply\">Leave a reply</span>

Whilst they both basically mean the same thing (obviously), they're used in 2 diffferent contexts, and as a result, can't be combined.

  • "Reply" is used for within the Comment bubble, this text is there for screen readers/etc, the "Reply" text remains hidden for normal users, 1 and % are the number of comments.
  • "Leave a reply" is used in the article meta's, this is the text links people see and click on.

#10 @nbachiyski
14 years ago

content-image.php:34:
The best I can think of is:

%1$s by %2$s %3$s

with the following explanations: 1: opening tags before "by", 2: closing tags after "by", 3: post author

image.php:29
What about

%1$s Published %2$s on %3$s at %4$s in %5$s

1: opening tags before "Published", 2: closing tags after "Published", 3: date, 4: image resolution, 5: gallery name.

functions.php:556
Wow, this one has many tags, wrapping many different levels of the string. Guys, do we really need the by-author span? And all the sep spans? The sep are the normal text, which can be easily caught with CSS (style it first, then style all other parts on top of it), and I don't see much point in by-author.

#11 follow-up: @iandstewart
14 years ago

The by-author class is used to hide the author name with CSS on single author sites.

#12 in reply to: ↑ 11 @nbachiyski
14 years ago

Replying to iandstewart:

The by-author class is used to hide the author name with CSS on single author sites.

OK, I see it now :-)

Ian, do you see a way to simplify this string? Probably not making it a long sentence, but listing the attributes in another manner. Or will it break the coherence between all the page types?

#13 @iandstewart
14 years ago

I can see breaking it up visually so it's not a long sentence — and easier to translate — but that makes it more complicated visually and less, twentyeleven-ish.

#14 @dd32
14 years ago

Those replacement strings look a lot better, easier for translators, and still allows the theme to have so many classes.

However, the .sep class isn't even used by the theme in the body, It wraping Posted on seems useless to me, I'm not sure it's even really needed in the rest of these strings, like you said, target the entire string, style the individuals.

functions.php

My suggestion (If removing some of the sep classes from some strings can be done for simplification)

Posted on %1$s <span class=\"by-author\"> by %2$s</span>

It retains a span in there(see below), but is vastly more simple than it's predecessor.

and I don't see much point in by-author.

Funny you should mention that, I was just about to suggest adding it to another string (and removing a then duplicate string), As you've spotted, it's to hide the author on single author sites, unfortunately, it's only actually applied in one of 3 or 4 strings.

These 2 strings are almost identical, I'd be willing to suggest the first one should be replaced by the 2nd one:

  1. This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Used in content-featured.php, ie. only for the "Featured Post" on the showcase template
  2. This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>. Used in content-single.php - ie. for singular views of posts and Custom Post Types.

Or, if the theme is to keep the by-author class, it should probably be changed to:

  • This entry was posted in %1$s<span class="by-author"> by <a href="%6$s">%5$s</a></span>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.

We also need another string for custom post types as well (As mentioned in #17748) as Custom Post Types don't have categories (normally)

  • <span class="by-author">This entry was posted by <a href="%6$s">%5$s</a></span>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.

#15 @ramiy
14 years ago

+1 for: "Leave a reply" => "Reply"

#16 in reply to: ↑ 9 @xibe
14 years ago

Replying to dd32:

<span class=\"leave-reply\">Reply</span> and <span class=\"leave-reply\">Leave a reply</span>

Whilst they both basically mean the same thing (obviously), they're used in 2 diffferent contexts, and as a result, can't be combined.

Note that I am not here suggesting simplification by combination, but rather: do you need the tags in string, or couldn't we simply have respectively 'Reply' and 'Leave a reply'?

#17 @azaozz
14 years ago

-1. Aren't strings frozen as of RC1? Seems too late for changes.

#18 @azaozz
14 years ago

  • Milestone changed from 3.2 to Future Release

#19 @dd32
14 years ago

-1. Aren't strings frozen as of RC1? Seems too late for changes.

It was specifically mentioned in the freeze announcement to expect TwentyEleven string changes past RC1 since they still needed review.

#20 @nacin
14 years ago

  • Milestone changed from Future Release to 3.2

Twenty Eleven strings are not frozen.

#21 @nbachiyski
14 years ago

I am sorry for the delay, I will take care of fixing these today.

#22 follow-up: @nbachiyski
14 years ago

Here is a patch, which takes out the tags from the reply strings, adds context to the comment numbers and converts some argument strings to arrays.

#23 @nbachiyski
14 years ago

  • Keywords has-patch dev-feedback commit added

#24 in reply to: ↑ 22 @ramiy
14 years ago

Replying to nbachiyski:

Here is a patch, which takes out the tags from the reply strings, adds context to the comment numbers and converts some argument strings to arrays.

It's a good patch. Too many strings in wordpress has HTML tags, we need take them out from the translated text.

#25 @azaozz
14 years ago

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

In [18348]:

Simplify some Twenty-Eleven strings for i18n, props nbachiyski, fixes #17777

Note: See TracTickets for help on using tickets.