WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. andamira
    Member
    Posted 6 months 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

    https://wordpress.org/plugins/ultimate-tag-cloud-widget/

  2. Rickard Andersson
    Member
    Plugin Author

    Posted 5 months ago #

    Thanks, will include it in the next version.

  3. Rickard Andersson
    Member
    Plugin Author

    Posted 4 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic