Ultimate Tag Cloud Widget
[resolved] make '%d topics' text for the title translatable (3 posts)

  1. andamira
    Posted 2 years ago #

    Hi, first of all, thank you for your fantastic plugin,

    I found some untranslatable text. The text that shows the number of topics of the labels is hardcoded and therefore can't be translated using gettext.

    To fix that, in the file src/Render.php:251 these two lines:

    $term_title_singular = $this->plugin->applyFilters('utcw_render_term_title_singular', '%d topic');
                    $term_title_plural   = $this->plugin->applyFilters('utcw_render_term_title_plural', '%d topics');

    should be:

    $term_title_singular = $this->plugin->applyFilters('utcw_render_term_title_singular', __('%d topic', 'utcw') );
                    $term_title_plural   = $this->plugin->applyFilters('utcw_render_term_title_plural', __('%d topics','utcw') );

    Tested after that change and it works


  2. Rickard Andersson
    Plugin Author

    Posted 2 years ago #

    Thanks, will include it in the next version.

  3. Rickard Andersson
    Plugin Author

    Posted 2 years ago #

    Just looked closer at this now, you should be able to translate the strings passed to _n() here:

    $title = _n($term_title_singular, $term_title_plural, $term->count);

    However domain is missing so I will add that there instead of your suggested solution.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ultimate Tag Cloud Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic