Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • obliat Friend
    #164578

    I do get 0 Comment instead ot 0 Comments (which makes sense in my language – Bulgarian)

    I can see it’s defined in components/com_jacomment/controllers/comments.php starting line 776 on:

    $object [$k]->id = '#jac-number-total-comment';
    $object [$k]->type = 'html';
    if($totalAll<=1){
    $message = JText::_("Comment");
    }else{
    $message = JText::_("Comments");
    }

    Now I thought that by removing “<” from if($totalAll<=1){ I’ll force it to show Comment (in single) if there is exactly 1 comment and else it will show Comments (in plural) for 0 and rest, but with 0 I still get Comment (instead of Comments), so I guess the way is not by just removing “<“?!?

    khoand Friend
    #393439

    Hi,
    You replace “<=” with “==”

    obliat Friend
    #393446

    Thank you, I made the change and now it looks like that:

    if($totalAll==1){
    $message = JText::_("Comment");
    }else{
    $message = JText::_("Comments");

    but I still have “0 Comment” /not “0 Comments”/ (in BG, taken from the lang file where I do have Comment & Comments translated accordingly). It shows 1 Comment, which is correct, but still shows it with 0 as well :((

    khoand Friend
    #393491

    You find this code from componentscom_jacommentthemesdefaulthtmlcommentstotal.php file


    <h2 class="componentheading"><span id="jac-number-total-comment"><?php echo $this->totalAll; ?> <?php if($this->totalAll > 1){echo JText::_("Comments");}else{echo JText::_("Comment");}?></span>

    Replace “>” with “!=”

    obliat Friend
    #393510

    😎 Thanks a lot – now it works fine.

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 2 voices, and was last updated by  obliat 13 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum