Archived topic
Previous and Next missing translation
9 replies · Started by Hilton on May 3, 2022
Hi,
Despite being right in the theme translation file, I don't know why the pagination at the end of the listings keeps showing "Previous" and "Next".
https://bit.ly/3MSln2d (live page)
https://capture.dropbox.com/yrb0m82ot0KvUIPc
https://capture.dropbox.com/fA7KbAxhUzIV9bev
Could you help?
Thanks
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">←</span>');
} );
add_filter( 'generate_next_link_text', function() {
return sprintf('Your Next Text %s', '<span aria-hidden="true">→</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.
Hi David, so shouldn't it have been translated using Loco Translate?
https://capture.dropbox.com/fA7KbAxhUzIV9bev
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
All theme translations can be found here: https://translate.wordpress.org/projects/wp-themes/generatepress/