Strings containing new lines like emails content are not translated
(note : backslashes are removed on the forum, so “n” is “backslash-n”)
I have a problem concerning the translation using the po/mo files. Everything works fine except for the emails content because of the new lines. Not the \n new line, but real new lines in code, as for example the file bp-groups-notifications.php:21 :
$message = sprintf( __(
‘Group details for the group “%s” were updated:
To view the group: %s
‘, ‘buddypress’ ), $group->name, $group_link );
Using Poedit myself or using the official translations (french in my case) generates the same po entry :
“Group details for the group “%s” were updated:n”
“To view the group: %sn”
“Les options de la famille “%s” ont été mises à jour:n”
“Accéder à la famille: %sn”
In run time, the match is not made and therefore the content is not translated. The only way will be to add_filters to modify the email content, replacing the real new lines by n.
Any idea how to solve it ?
The topic ‘Strings containing new lines like emails content are not translated’ is closed to new replies.