Site logo

Archived topic

Previous and Next missing translation

9 replies · Started by Hilton on May 3, 2022

Viewing posts 1–10 of 10

Hi Hilton,

You can try adding a PHP code like this to modify the Previous and Next text:

add_filter( 'generate_previous_link_text', function() {
	return sprintf('%s Your Previous Text', '<span aria-hidden="true">&larr;</span>');
} );

add_filter( 'generate_next_link_text', function() {
	return sprintf('Your Next Text %s', '<span aria-hidden="true">&rarr;</span>');
} );

Kindly replace “Your Previous Text” and “Your Next Text” with your preferred text in the language you prefer.

Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

Adding it through Code Snippets should work.

Kindly let us know how it goes. :)

Hi, why can't you use the theme translation file?

Hi there,

here are the two translation strings:

__( '%s Previous', 'generatepress' )

__( 'Next %s', 'generatepress' )

It may be the %s placeholders used to insert the arrow icons are not included in the translation entry.

I would say yes, but translations are not my strong suit, so i cannot say why that is not working.

I can pass this over to Tom to take a look if you wish? Let me know.

Thanks David, I look forward to an answer. Please see this with Tom.

Very strange, there isn't anything special about those specific strings except that they contain %s. Can you bring this up with Loco Translate? Perhaps it's a known issue.

Let me know :)

Hi Tom, just to validate this, could you tell me where are the translation files? This way I can check directly on them to ensure that it is a Loco issue. Thanks

This archived topic is closed to new replies.