• Resolved jereruira

    (@jereruira)


    I’m trying to do something that I thought would be easy. As always, it isn’t.
    I want the word ‘comments’ in the comments_popup_link below the posts to show in the selected language in my multilingual site.
    I’m using the plugin gengo and wordpress 2.2.2

    <?php gengo_snippet(‘comments’); ?> shows the word ‘comments’ in the selected language.

    I put this in the comments_popup_link on the main-index page, but it doesn’t work.

    I tried to separate the code by using ‘$something’.
    My latest try looks like this:

    <p class=”postmetadata”>

    <?php
    $something=comments_number(‘0 ‘,’1 ‘,’% ‘) . gengo_snippet(‘comments’);
    comments_popup_link($something,$something,$something,”,’comments off’)
    ?>

    </p>

    It looks quite alright but it doesn’t put out the link.

    I’m sure this is due to my limited understanding of php.
    If anyone could give me a hint?

    It was fun for the first 12 hours, but I’m getting tired… ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Normally, that string should be translated by the basic WP .mo file, if it is coded correctly in the theme, i.e. prepared for internationalization. I have this, and not Gengo, but the basic WP translation translates it:
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'), 'commentlink'); ?>

    Thread Starter jereruira

    (@jereruira)

    Thanks for your hint. Tried it, but my plugin didn’t like it.

    That solution doesn’t work with gengo, as it does only allow one language as wp_lang in the wp_config file. So automatic translation doesn’t seem to be an option.

    I’m still trying to change the code posted above to make it work.
    I don’t understand why the gengo_snippet function conflicts with the comments_popup_link. If I replace the gengo-function with, i.e. the the_date function, it works fine.

    Thread Starter jereruira

    (@jereruira)

    problem solved (kind of):

    I just used the comments_link instead.

    It’s a work-around, as this doesn’t show the number of comments. But I decided to do without.

    Needed some time, but finally I managed to put my little head to work.

    Thanks for your answer, moshu.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘translating the comments_popup_link with gengo’ is closed to new replies.