-
Notifications
You must be signed in to change notification settings - Fork 74
Internationalisation fixes #1088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…le. Maintains late escaping discipline.
Codecov Report
@@ Coverage Diff @@
## master #1088 +/- ##
==========================================
- Coverage 32.05% 25.81% -6.25%
==========================================
Files 31 31
Lines 2561 3653 +1092
==========================================
+ Hits 821 943 +122
- Misses 1740 2710 +970
Continue to review full report at Codecov.
|
admin/constants.php
Outdated
__( 'You can define any of the following constants in your %1$s file to control advanced settings. <a href="%2$s">The Codex can help</a>. Defined constants will be highlighted.', 'backupwordpress' ), | ||
'<code>wp-config.php</code>', | ||
'https://codex.wordpress.org/Editing_wp-config.php' | ||
); ?></p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnbillion is there a reason why these aren't escaped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escaping translations is something that I personally recommend strongly, but isn't strictly necessary. I think BWP should escape all of its translations, but that's something that would be better one all at once, and separately from these other enhancements.
classes/class-email-service.php
Outdated
esc_html__( 'If the errors above look like Martian, forward this email to %3$s and we\'ll take a look', 'backupwordpress' ) . "\n\n" . | ||
home_url(), | ||
$error_message, | ||
'[email protected]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnbillion I wanted to make this one string, but then how would I deal with \n\n
? Just add them like that in the string? There are few vars like this in this file. Are they ok to be merged into one string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok as separate strings with "\n\n"
concatenating them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
home_url()
needs to be escaped. Is $error_message
safe? This whole string should be wrapped in esc_html()
instead of the individual esc_html__()
usage.
'<p>' . sprintf( | ||
__( 'BackUpWordPress Pro supports Dropbox, Google Drive, Amazon S3, Rackspace, Azure, DreamObjects and FTP/SFTP. <a href="%s" target="_blank">Check it out at bwp.hmn.md</a>', 'backupwordpress' ), | ||
'https://bwp.hmn.md/?utm_source=wordpress-org&utm_medium=plugin-page&utm_campaign=freeplugin' | ||
) . '</p>' . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pdewouters I think you've mentioned that these files have to have a specific format otherwise they won't be processed. Will it cope if we use sprintf()
and esc_html__()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
@Dasha are you still working on this? Any idea when it might be done? |
Since this overlays #1090 so closely, I think we could probably work on this one after that gets merged. It is quite stale but could be re-picked up. |
Wow, not quite sure why it wasn't merged before as it was in pretty good state. Not sure how to better approach this now as things still need fixing. |
I'm picking this up. |
esc_url( home_url() ), | ||
$error_message, | ||
'[email protected]' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnbillion How does this look? Addressing your feedback that the whole message should be a one string. Ref 93c7a40#r75849252
…breaks in double quotes
Right, let's do a final push on this one :) Can someone review please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although the tabbing in a couple places looked weird.
classes/class-email-service.php
Outdated
esc_html__( | ||
'BackUpWordPress was unable to backup your site %1$s.' . "\n\n" . | ||
'Here are the errors that we\'ve encountered: %2$s' . "\n\n" . | ||
'If the errors above look like Martian, forward this email to %3$s and we\'ll take a look.' . "\n\n", 'backupwordpress' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabbing here is weird
classes/class-email-service.php
Outdated
'BackUpWordPress has completed a backup of your site %1$s'. "\n\n" . | ||
'The backup file should be attached to this email.' . "\n\n" . | ||
'You can download the backup file by clicking the link below:' . "\n\n" . '%2$s' . "\n\n" . | ||
'Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot', 'backupwordpress' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabbing here is also weird.
classes/class-email-service.php
Outdated
'BackUpWordPress has completed a backup of your site %1$s' . "\n\n" . | ||
'Unfortunately, the backup file was too large to attach to this email.' . "\n\n" . | ||
'You can download the backup file by clicking the link below:' . "\n\n" . '%2$s' . "\n\n" . | ||
'Kind Regards,\nThe Happy BackUpWordPress Backup Emailing Robot', 'backupwordpress' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and here.
@willmot I'm not sure what the process of preparing a new version is and when to merge PRs. But this is ready to go in 👍 |
@pdewouters any availability to handle review/merge and release? |
@pdewouters pinging about this one :) |
See the individual commit messages for explanations of the changes.