#7989 closed defect (bug) (fixed)
Translate "topic/topics" in the tag cloud
Reported by: | msi08 | Owned by: | ryan |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
Found a not translated text in "wp_generate_tag_cloud". This here will not work:
'single_text' => '%d topic', 'multiple_text' => '%d topics' __ngettext( $single_text, $multiple_text, $count )
poEdit and other tools will not detect the both strings and because of that you will not have them in the language file. The translation is impossible then.
Attachments (2)
Change History (8)
#3
@
16 years ago
- Keywords has-patch added
In general it is ok to use __ngettext()
as a function to choose the right form, based on a count, even if it is not translated. The patch above will work well in most of the cases. However, there are languages, which have different plural rules (different plural form for counts divisible by 13 and such strange stuff).
Here is a patch, which replaces the two arguments with one -- a callback, which given the count, returns the proper text. The default callback is an __ngettext()
call with '%s topic'
and '%s topics'
.
Backward compatibility is maintained, by checking if $args['single_text'
] and $args['multiple_text']
are defined and in that case a special callback, using these two is constructed.
ngettext() still needs to be removed.