• Resolved jaaaay

    (@jaaaay)


    I cannot figure out how to translate the word “in” shown in the forum widget before the forum title. I think it is on line 1001 of pg_forum_widgets.php. Is it possible?

    <?php if ( ! empty( $settings['show_forum'] ) ) : ?>
    					<div class = "pg-activity-forum">
    						<?php
    						$forum = bbp_get_topic_forum_id($topic_id);
    						$forum1 = bbp_get_forum_title($forum) ;
    						$forum2 = esc_url( bbp_get_forum_permalink( $forum )) ;
    						echo '<span class="pg-la-text">' ;
    						_e ( 'in ', 'bbp-private-groups' ) ;
    						echo '</span>' ; ?>
    						<a class="bbp-forum-title" href="<?php echo $forum2; ?>"><?php echo $forum1 ; ?></a>
    					</div>
    					<?php endif; ?>
    • This topic was modified 9 years ago by jaaaay.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Robin W

    (@robin-w)

    what language are you trying to translate it to?

    Thread Starter jaaaay

    (@jaaaay)

    French

    Just to clarify, I cannot find any reference to the string that contains the word “in” in the .po file.

    • This reply was modified 9 years ago by jaaaay.
    Plugin Author Robin W

    (@robin-w)

    Let me see if I can fix that for you !

    Plugin Author Robin W

    (@robin-w)

    ok, I’ve added it to the pot, but worpdress now has a ridiculous way that translations work, so I cannot control it’s release.

    in the meantime, try adding this to your theme’s functions file.

    function pg_text_strings( $translated_text, $text, $domain ) { 
    
    	if ($translated_text == 'in ' && $domain == 'bbp-private-groups' )  {
    	$translated_text = __( 'dans ', 'bbp-private-groups' ); 
    	} 
    return $translated_text;  
    }
    	
    add_filter( 'gettext', 'pg_text_strings', 20, 3 );
    • This reply was modified 9 years ago by Robin W.
    Thread Starter jaaaay

    (@jaaaay)

    Wow – you even translated it for me 😉

    Works nicely. Thank you!

    If I understand you right, I could also just leave my hardcoded changes in pg_forum_widgets.php and wait for your next release.

    Plugin Author Robin W

    (@robin-w)

    the way that translations work is bad now. it relies on someone in a wordpress team approving my changes, which may or may not ever happen !

    If you have hardcoded, then you will need to redo the entry each time I upgrade, which is fine if you are happy with that.

    Otherwise use the code above and you can forget it.

    the choice is yours!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Non-translatable string?’ is closed to new replies.