Opened 7 months ago

Last modified 7 months ago

#22172 new defect (bug)

Localized strings not applied in notification email

Reported by: pavelevap Owned by:
Priority: normal Milestone: Awaiting Review
Component: I18N Version: 3.4
Severity: normal Keywords:
Cc: pavelevap@…

Description

After user registration and activation (multisite), administrator receive email (function wpmu_signup_user_notification() in wp-includes/ms-functions.php). But content of this email is not translated even if localization file contains translated strings.

New User: %1s\n
Remote IP: %2s\n
\n
Disable these notifications: %3s

Email subject is localized, but content not. I am not sure about the cause of this problem...

Attachments (1)

22172.patch (425 bytes) - added by SergeyBiryukov 7 months ago.

Download all attachments as: .zip

Change History (4)

I can only reproduce on a TortoiseSVN checkout under Windows. There's a gettext bug that affects multiple line strings like this one or the one in welcome_user_msg_filter() due to different line endings on Windows and Unix.

Replacing actual line breaks with \n and keeping everything on one line could work, but it would also make the strings harder to read and translate:

"New User: %1s\nRemote IP: %2s\n\nDisable these notifications: %3s"

Related BuddyPress ticket: http://buddypress.trac.wordpress.org/ticket/2703

Could not reproduce on a regular (non-SVN) install.

22172.patch is an attempt to solve the line endings issue.

Thank you, Sergey! You are right, I am using Windows and TortoiseSVN.

I applied your patch and it works now without problem. So, WordPress can handle this problem easily...

I also tried replacing \n in original string, but then there were \n characters also in notification email.

There are many strings with \n and only some with \r\n. Maybe it should be unified? Readability should not be problem, GlotPress and Poedit can handle these situations easily for translators...

Note: See TracTickets for help on using tickets.