Translating a pager string

You are doing it wrong

  • You should translate the HTML string, not the function

  • When passing strings into functions, like what you are doing, you should use __() which returns the translated string. _e() would echo the string and you would get the raw text and the modified text on output

    Example of correct usage:

    get_next_posts_link( __( 'Older posts' ), $the_query->max_num_pages );
    

    or

    next_posts_link( __( 'Older posts' ), $the_query->max_num_pages );
    
  • _e() echos a string, so doing the following

    next_posts_link( _e( 'Older posts' ), $the_query->max_num_pages );
    

    would be wrong as you would get the following output

    Older postsNext Page »

    instead of

    Older posts

  • Instead of doing echo get_next_posts_link(), you can just do next_posts_link(). next_posts_link() is just a wrapper for echo get_next_posts_link()