Opened 19 years ago
Closed 19 years ago
#5131 closed enhancement (fixed)
wp_tag_cloud(): title='1 topics', should be 1 topic
| Reported by: | atppp | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5 |
| Component: | General | Version: | 2.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
I am picky...
Attachments (2)
Change History (17)
#1
@
19 years ago
- Keywords has patch added
- Milestone 2.5 → 2.3.1
- Type defect → enhancement
- Version → 2.3
#3
follow-up:
↓ 6
@
19 years ago
- Keywords has patch removed
This patch kills right-to-left language support.
#4
@
19 years ago
- Milestone 2.3.1 → 2.5
Please don't set the milestone, leave that for a core contributor.
#5
follow-up:
↓ 7
@
19 years ago
Replying to Nazgul:
This patch kills right-to-left language support.
Indeed, patch should be reworked to use __ngettext rather than __
#6
in reply to: ↑ 3
;
follow-up:
↓ 8
@
19 years ago
Replying to Nazgul:
This patch kills right-to-left language support.
Ooops. Is this because of the way how the digit is 'handwired' in front of the 'topics' label (like '1 topic'), whereas a right-to-left needs something like 'topic 1'? In the original it is sprintf( __('%d topics'), $count ), so the digit is in front of the label anyway? Sorry, I don't get the difference between a hardcoded 'topics' after the %d and the variable used in my patch sprintf( __('%d '.$topictxt), $count ).
Replying to foolswisdom:
Please don't set the milestone, leave that for a core contributor.
Ok, sorry for that.
Replying to westi:
Indeed, patch should be reworked to use __ngettext rather than __
well the original used __ , so I didn't messed with that.
#7
in reply to: ↑ 5
;
follow-up:
↓ 9
@
19 years ago
Replying to westi:
Indeed, patch should be reworked to use __ngettext rather than __
I see... would this work
original:
attribute_escape( sprintf( __('%d topics'), $count ) )
patch:
attribute_escape( __ngettext( 'topic', 'topics', $count )
?
#8
in reply to: ↑ 6
@
19 years ago
Replying to webrocker:
Replying to foolswisdom:
Please don't set the milestone, leave that for a core contributor.
Ok, sorry for that.
No serious problem of course! ;-) Keep up the great work!
#9
in reply to: ↑ 7
;
follow-up:
↓ 11
@
19 years ago
- Owner changed from to
- Status new → assigned
Replying to webrocker:
Replying to westi:
Indeed, patch should be reworked to use __ngettext rather than __
I see... would this work
original:
attribute_escape( sprintf( __('%d topics'), $count ) )
patch:
attribute_escape( __ngettext( 'topic', 'topics', $count )
?
Nearly __ngettext allows you to use plural forms in your translations e.g.:
__ngettext( '%d topic', '%d topics', $count)
This will output '1 topic' or '3 topics' giving you the correct plural form while still allowing translators to handle the "right to left" issues by translating the '%d topic' as something like 'topic %d'.
#11
in reply to: ↑ 9
@
19 years ago
Replying to westi:
__ngettext( '%d topic', '%d topics', $count)
This will output '1 topic' or '3 topics' giving you the correct plural form while still allowing translators to handle the "right to left" issues by translating the '%d topic' as something like 'topic %d'.
Ok, I think I'm getting it... so it still needs to be used inside the sprintf() function, so that the %d thingie gets replaced with $count, while the __ngettext() needs another instance of $count to determine if $single or $plural is to be used?
So this should work:
attribute_escape( sprintf( __ngettext( '%d topic', '%d topics', $count ), $count ) )
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
been there done that :)