Today, my posts in this website reached more than 10 articles. Therefore, there was an “Older entries” link showed-up in the bottom of my front page. Well, I want this link text become pagination link that automatically detects the number of the page. So I searched, found, and used WP-PageNavi plugin for this purpose, and everything seemed okay so far until I found a little bit problem. This plugin has not fully supported multi-language, especially my own language; bahasa Indonesia, yet. When the pagination link showed-up, it bothered me that the Page and of words have not been translated to my language when I choose my language as the selected language. So I decided to modify this plugin’s script. Edited: This following modification being applied for 2.73 (the last version when I edited this article). I have sent the .mo and .po files to the author in order to be included into the next release.
-
Open core.php file, and find this code:
60 61 62 63
$pages_text = str_replace( array( "%CURRENT_PAGE%", "%TOTAL_PAGES%" ), array( number_format_i18n( $paged ), number_format_i18n( $total_pages ) ), $options['pages_text'] );
then replace it with this following code:
60 61 62 63
$pages_text = str_replace( array( "%CURRENT_PAGE%", "%TOTAL_PAGES%" ), array( number_format_i18n( $paged ), number_format_i18n( $total_pages ) ), __('Page %CURRENT_PAGE% of %TOTAL_PAGES%','wp-pagenavi') ); // Modified by Masino Sinaga, August 29, 2010 in order to support multi language; old: $options['pages_text']
-
Find again this code:
69
$out .= _wp_pagenavi_single( 1, 'first', $first_text, '%TOTAL_PAGES%' );
then replace it with this following code:
69
$out .= _wp_pagenavi_single( 1, 'first', __($first_text,'wp-pagenavi'), '%TOTAL_PAGES%' ); // Modified by Masino Sinaga, August 29, 2010, in order to support multi language
-
Find again this code:
115
$out .= _wp_pagenavi_single( $total_pages, 'last', $options['last_text'], '%TOTAL_PAGES%' );
then replace it with this following code:
115
$out .= _wp_pagenavi_single( $total_pages, 'last', __($options['last_text'],'wp-pagenavi'), '%TOTAL_PAGES%' ); // Modified by Masino Sinaga, August 29, 2010 in order to support multi language
Now the link has used my language when this language selected. It become: Halaman x dari y.

wow so nice the web
Thanks! Yours, too.
Thank You!
Oh my Gosh! It’s the very first time that I found code snippets and an explanation that both works! Thank you very much.
This worked perfectly – thank you.
Incredible. After 2 years of posted it still works !
Good job !
Makasih bang! It did help!!!
I can confirm that it works beautifully on WPML 2.4.2 and WP3.3.1 (line numbers are slighty different, and the function _wp_pagenavi_single is now $instance->get_single). Thank you for the post.