Make WordPress Core

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#16998 closed defect (bug) (fixed)

Default Link Label on Next and Previous Links Functions not Tanslated

Reported by: charlesclarkson's profile CharlesClarkson Owned by:
Milestone: 3.2 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch dev-feedback
Focuses: Cc:

Description

The default link $label parameter on these Previous/Next posts functions is not translatable.

get_next_posts_link()
next_posts_link()
get_previous_posts_link()
previous_posts_link()

The path handles the label text the same way as the comment Previous/Next links in the same file (/wp-includes/link-template.php).

This patch might break a plugin or theme which relies on passing in the function call. I'm not sure why anyone would do that to a link text label, but ...

Attachments (3)

16998.diff (2.2 KB) - added by CharlesClarkson 14 years ago.
16998.2.diff (1.7 KB) - added by nathanrice 13 years ago.
Translate $label, use null and is_null for backward compatibility
16998.3.diff (1.7 KB) - added by nathanrice 13 years ago.
Translate $label, use null and a strict check for backward compatibility

Download all attachments as: .zip

Change History (8)

#1 @CharlesClarkson
14 years ago

This patch might break a plugin or theme which relies on passing an empty string in the function call. I'm not sure why anyone would do that to a link text label, but ...

get_next_posts_link('')

#2 @nathanrice
13 years ago

  • Cc ncrice@… added
  • Component changed from General to I18N
  • Keywords has-patch dev-feedback added

+1

Having the default text non-translatable is bad form for international users, and places the burden on theme developers to pass their own translatable text to these functions in order to use them properly.

#3 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.2

We can change this to null as the default. Then a strict check would avoid any edge cases with an empty string.

@nathanrice
13 years ago

Translate $label, use null and is_null for backward compatibility

@nathanrice
13 years ago

Translate $label, use null and a strict check for backward compatibility

#4 @ryan
13 years ago

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

(In [17728]) Translate default link labels for *posts_link(). Props nathanrice, CharlesClarkson. fixes #16998

#5 @ryan
13 years ago

I tweaked the patches a bit to do null === like we do elsewhere for default labels.

Note: See TracTickets for help on using tickets.