Opened 14 years ago
Closed 14 years ago
#2703 closed defect (bug) (wontfix)
[Translations] Cannot translate strings when actual new line breaks are used instead of \n
Reported by: | calvin_42 | Owned by: | sorich87 |
---|---|---|---|
Milestone: | 1.5 | Priority: | major |
Severity: | Version: | ||
Component: | Core | Keywords: | 2nd-opinion close |
Cc: |
Description
From the support thread Strings containing new lines like emails content are not translated .
Rather than using actual line breaks in strings, using \n and keeping everything on one line resolves this issue. These strings are most of the time the content of the notification emails.
For example, in bp-groups-notifications.php:22 :
Replace :
$message = sprintf( __( 'Group details for the group "%s" were updated: To view the group: %s --------------------- ', 'buddypress' ), $group->name, $group_link );
By:
$message = sprintf( __( 'Group details for the group "%s" were updated:\n\nTo view the group: %s\n\n---------------------\n', 'buddypress' ), $group->name, $group_link );
Attachments (2)
Change History (12)
#2
@
14 years ago
- Milestone changed from 1.2.7 to 1.3
No, don't want to change any strings in 1.2.7 if at all possible, to avoid translators having to update language files for a tiny bug-fix release. 1.3's not far away, however.
#3
@
14 years ago
- Keywords has-patch added
- Owner set to sorich87
- Status changed from new to accepted
#4
@
14 years ago
2703.diff breaks the swappable characters. Because they appear in double-quotes (to make the line breaks work), the $s in %1$s is getting processed as an empty variable. sorich87, could you repatch and escape them so they read %1\$s ?
#6
@
14 years ago
- Keywords needs-patch added; has-patch removed
Could this be re-patched per Boone's comments, without any other changes? Whilst the other bits in 2703.002.diff are good, the patch won't apply because of changes in trunk. The more concise patches are, the easier they are to manually apply in such cases.
#7
@
14 years ago
This has to do with different line endings on Windows and Unix.
WordPress has multiple line strings too, which are perfectly valid unless using TortoiseSVN checkout under Windows.
The suggestion in the ticket would make the strings extremely hard to read and translate.
It's actually a gettext bug and should be treated on a more general level, perhaps in WordPress itself.
Shouldn't take too long to replace, so maybe for milestone 1.2.7 ?