notifications: i18n: Mark app names and extra data for translation

Helps: 1938.

Testing:
- Yapf applied.
- Flake8 without errors or warnings for changed files.
- (Unit) tests run without errors.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Translate app_name with 'translate:' prefix]
[sunil: Also mark additional data]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Fioddor Superconcentrado authored and Sunil Mohan Adapa committed 2020-10-20 11:57:17 -07:00
1 parent ff9d0ace31
commit 9cde408c86
4 files changed
+10 -6

No files matched your search

+1 -1
View File
@@ -223,7 +223,7 @@ def _warn_about_low_ram_space(request):
title = ugettext_noop('Low Memory')
data = {
'app_icon': 'fa-heartbeat',
'app_name': ugettext_noop('Diagnostics'),
'app_name': 'translate:' + ugettext_noop('Diagnostics'),
'percent_used': f'{memory_info["percent_used"]:.1f}',
'memory_available': f'{memory_available:.1f}',
'memory_available_unit': 'translate:' + memory_available_unit,
+7 -3
View File
@@ -309,14 +309,14 @@ def warn_about_low_disk_space(request):
title = ugettext_noop('Low disk space')
data = {
'app_icon': 'fa-hdd-o',
'app_name': ugettext_noop('Storage'),
'app_name': 'translate:' + ugettext_noop('Storage'),
'percent_used': root_info['percent_used'],
'free_space': format_bytes(root_info['free_bytes'])
}
actions = [{
'type': 'link',
'class': 'primary',
'text': 'Go to {app_name}',
'text': ugettext_noop('Go to {app_name}'),
'url': 'storage:index'
}, {
'type': 'dismiss'
@@ -338,7 +338,11 @@ def report_failing_drive(id, is_failing):
message = ugettext_noop(
'Disk {id} is reporting that it is likely to fail in the near future. '
'Copy any data while you still can and replace the drive.')
data = {'id': id}
data = {
'app_icon': 'fa-hdd-o',
'app_name': 'translate:' + ugettext_noop('Storage'),
'id': id
}
note = Notification.update_or_create(id=notification_id, app_id='storage',
severity='error', title=title,
message=message, actions=[{
+1 -1
View File
@@ -100,7 +100,7 @@ class UpgradesApp(app_module.App):
data = {
'version': plinth.__version__,
'app_name': 'Update',
'app_name': 'translate:' + ugettext_noop('Updates'),
'app_icon': 'fa-refresh'
}
title = ugettext_noop('FreedomBox Updated')