Plugin Author
Tim W
(@timwhitlock)
All files must be part of a bundle. link-template.php is part of the WordPress core bundle, so I don’t recommend creating a POT for just one file in this way.
The approach I recommend is to download the core language pack for your language. When installed, Loco Translate will pick this up.
Then if you want to customize some of these translations to your liking, try following guide to overriding translations.
If you want to generate a POT file for the whole of the WordPress core, you can do this within Loco Translate. But it’s not really necessary if the above approach works for you. If there’s some reason it doesn’t, feel free to elaborate.
The above approach won’t work because I’ve modified link-template.php myself.
The part I modified is line 2480:
if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
$args = wp_parse_args( $args, array(
'prev_text' => __( 'See previous posts' ),
'next_text' => __( 'See newer posts' ),
'screen_reader_text' => __( 'Posts navigation' ),
) );
I want it to read:
if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
$args = wp_parse_args( $args, array(
'prev_text' => __( 'See previous deals' ),
'next_text' => __( 'See newer deals' ),
'screen_reader_text' => __( 'Posts navigation' ),
) );
Is there a way to achieve this without modifying the core file?
Plugin Author
Tim W
(@timwhitlock)
Never modify the WordPress core.
Also, never modify source strings as means of translation. Translate them.
It’s perfectly valid to translate from English to English. i.e. Translate “See newer posts” to “See newer deals”.
My earlier comments still apply. I suggest (as you appear to be British?) that you download the en-GB language packs. Then set your site to British English. Then to change the strings as above, copy the core en-GB translation files and override the text (see earlier guide on how to do that).