Fioddor Superconcentrado 43ab6db456
i18n: Mark strings missed for translation
Helps: #1938.

    backups/forms.py:
	- ChoiceField labeled to allow translation.
	- Translation applied to hard coded literals.

    config/forms.py:
	Lazy translation applied to literals that were translated but still
	displayed in english to non-english users.

    diagnostics_results.html:
	Apply translation to results. Use gettext_noop to mark for translation.

    dynamicdns/forms.py:
	Apply translation to choice literals.

    i2p/views.py:
	Lazy translation applied to literals that were translated but still
	displayed in english to non-english users.

    names.html:
	Apply translation to table headers.

    performance/__init__.py:
	Apply translation to description literals.

    radicale/forms.py:
	ChoiceField labeled to allow translation.

    users/forms.py:
	CharField labeled to allow translation.

    QA:
	- Literals visually verified.
	- No errors in py.test-3.
	- Yapf applied (only) to changed files.
	- No remarks by flake8 to changed file.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Separate out the translations]
[sunil: Fix i18n for diagnostics]
[sunil: dynamicdns: Also do i18n for string GnuDIP]
[sunil: searx: Revert an incorrect removal of import]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-09-14 15:39:19 -07:00

77 lines
2.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
FreedomBox app for System Monitoring (cockpit-pcp) in System.
"""
from django.utils.translation import ugettext_lazy as _
from plinth import app as app_module
from plinth import menu
from plinth.daemon import Daemon
from .manifest import clients
version = 1
name = _('Performance')
managed_services = [
'pmcd.service', 'pmie.service', 'pmlogger.service', 'pmproxy.service'
]
managed_packages = ['cockpit-pcp']
_description = [
_('Performance app allows you to collect, store and view information '
'about utilization of the hardware. This can give you basic insights '
'into usage patterns and whether the hardware is overloaded by users '
'and services.'),
_('Performance metrics are collected by Performance Co-Pilot and can be '
'viewed using the Cockpit app.'),
]
app = None
class PerformanceApp(app_module.App):
"""FreedomBox app for Performance."""
app_id = 'performance'
def __init__(self):
"""Create components for the app."""
super().__init__()
info = app_module.Info(app_id=self.app_id, version=version,
name=_('Performance'), icon='fa-bar-chart',
short_description=_('System Monitoring'),
description=_description,
manual_page='Performance', clients=clients)
self.add(info)
menu_item = menu.Menu('menu-performance', info.name,
info.short_description, info.icon,
'performance:index', parent_url_name='system')
self.add(menu_item)
daemon_0 = Daemon('daemon-performance-0', managed_services[0],
listen_ports=None)
self.add(daemon_0)
daemon_1 = Daemon('daemon-performance-1', managed_services[1],
listen_ports=None)
self.add(daemon_1)
daemon_2 = Daemon('daemon-performance-2', managed_services[2],
listen_ports=None)
self.add(daemon_2)
daemon_3 = Daemon('daemon-performance-3', managed_services[3],
listen_ports=None)
self.add(daemon_3)
def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('post', app.enable)