Always keep in mind: your translators might need need to reorder all words. So you cannot insert dynamic values into translatable strings like you did here.
Use sprintf()
or printf()
and placeholders instead:
$string = _x(
'This article has %s words to read',
'%s = number of words',
'your_textdomain'
);
printf( $string, number_format_i18n( str_word_count($post->post_content) ) );
$string = _x(
'Page %1$s of %2$s',
'%1$s = current page, %2$s = all pages',
'your_textdomain'
);
echo "<div class="pagination"><span>"
. sprintf( $string, $paged, $pages )
. "</span>";
No placeholder is needed in this case:
echo "<a href="" . get_pagenum_link($paged + 1)."">"
. _( 'Next ›', 'your_textdomain' )
. "</a>";