I’m rebuilding my website from a child theme of twentytwelve to child theme of twentyfourteen. Most of the functions I’m using comes from tutorials, so most of the string aren’t localized. With this child theme I’m working on I really want to localize the theme because I want to use the theme on an Afrikaans website and on an English website.
I want to now what is the correct way to localize these following strings:
echo ' #This article have ' . str_word_count($post->post_content) . ' words to read!';
and
echo "<div class="pagination"><span>Page ".$paged." van ".$pages."</span>";
and
echo "<a href="".get_pagenum_link($paged + 1)."">Next ›</a>";
Many thanks in advance
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()
orprintf()
and placeholders instead:No placeholder is needed in this case: