Merge pull request #24494 from barredterra/google-drive-translatability
This commit is contained in:
commit
0b614178bb
2 changed files with 7 additions and 6 deletions
|
|
@ -13,13 +13,14 @@ frappe.ui.form.on("Google Drive", {
|
|||
|
||||
frappe.realtime.on("upload_to_google_drive", (data) => {
|
||||
if (data.progress) {
|
||||
const progress_title = __("Uploading to Google Drive");
|
||||
frm.dashboard.show_progress(
|
||||
"Uploading to Google Drive",
|
||||
progress_title,
|
||||
(data.progress / data.total) * 100,
|
||||
__("{0}", [data.message])
|
||||
data.message
|
||||
);
|
||||
if (data.progress === data.total) {
|
||||
frm.dashboard.hide_progress("Uploading to Google Drive");
|
||||
frm.dashboard.hide_progress(progress_title);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ def upload_system_backup_to_google_drive():
|
|||
validate_file_size()
|
||||
|
||||
if frappe.flags.create_new_backup:
|
||||
set_progress(1, "Backing up Data.")
|
||||
set_progress(1, _("Backing up Data."))
|
||||
backup = new_backup()
|
||||
file_urls = []
|
||||
file_urls.append(backup.backup_path_db)
|
||||
|
|
@ -196,12 +196,12 @@ def upload_system_backup_to_google_drive():
|
|||
frappe.throw(_("Google Drive - Could not locate - {0}").format(e))
|
||||
|
||||
try:
|
||||
set_progress(2, "Uploading backup to Google Drive.")
|
||||
set_progress(2, _("Uploading backup to Google Drive."))
|
||||
google_drive.files().create(body=file_metadata, media_body=media, fields="id").execute()
|
||||
except HttpError as e:
|
||||
send_email(False, "Google Drive", "Google Drive", "email", error_status=e)
|
||||
|
||||
set_progress(3, "Uploading successful.")
|
||||
set_progress(3, _("Uploading successful."))
|
||||
frappe.db.set_single_value("Google Drive", "last_backup_on", frappe.utils.now_datetime())
|
||||
send_email(True, "Google Drive", "Google Drive", "email")
|
||||
return _("Google Drive Backup Successful.")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue