How do I translate this string – PHP syntax question

I need some help on how to correctly format this code snippet for translation:

<?php next_post_link( '%link', __( '<span class="meta-nav">←</span> Nästa nyhet') ); ?>

I’ve used this method in my theme before:

_e( 'Nästa nyhet', 'mytheme');

But I don’t know how to correctly type the _e translation method in my link output.
I want to translate “Nästa nyhet”.

Anyone?

1 Answer
1

Don’t wrap the entire section in __(), just wrap the part you need to translate:

<?php next_post_link( '%link', '<span class="meta-nav">←</span> ' . __( 'Nästa nyhet', 'mytheme' ) ); ?>

Leave a Comment