From 699266fdc1ca0617071b08bf598b2f837d452734 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 19 Aug 2020 18:32:52 -0700 Subject: [PATCH] help, networks: Clarify i18n different contexts for "Manual" The word "Manual" means 'user guide' in case of help and 'not automatically' in case of networking app. After change, POT file is produced as follows: msgctxt "User guide" msgid "Manual" msgstr "" msgctxt "Not automatically" msgid "Manual" msgstr "" Closes: #1922. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Joseph Nuthalapati --- plinth/modules/help/__init__.py | 4 +++- plinth/modules/networks/forms.py | 7 +++++-- plinth/templates/help-menu.html | 4 ++-- plinth/templates/index.html | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plinth/modules/help/__init__.py b/plinth/modules/help/__init__.py index 4addcb579..eed3852df 100644 --- a/plinth/modules/help/__init__.py +++ b/plinth/modules/help/__init__.py @@ -5,6 +5,7 @@ FreedomBox app for help pages. import os +from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from plinth import app as app_module @@ -32,7 +33,8 @@ class HelpApp(app_module.App): menu_item = menu.Menu('menu-help', _('Documentation'), None, 'fa-book', 'help:index', parent_url_name='index') self.add(menu_item) - menu_item = menu.Menu('menu-help-manual', _('Manual'), None, + menu_item = menu.Menu('menu-help-manual', + pgettext_lazy('User guide', 'Manual'), None, 'fa-info-circle', 'help:manual', parent_url_name='help:index', order=10) self.add(menu_item) diff --git a/plinth/modules/networks/forms.py b/plinth/modules/networks/forms.py index e3166bc4b..07a11d034 100644 --- a/plinth/modules/networks/forms.py +++ b/plinth/modules/networks/forms.py @@ -2,6 +2,7 @@ from django import forms from django.core import validators +from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from plinth import cfg, network @@ -44,7 +45,8 @@ class ConnectionForm(forms.Form): 'clients on this network and share its Internet connection.'), box_name=_(cfg.box_name)), choices=[('auto', _('Automatic (DHCP)')), ('shared', _('Shared')), - ('manual', _('Manual')), ('disabled', _('Disabled'))]) + ('manual', pgettext_lazy('Not automatically', 'Manual')), + ('disabled', _('Disabled'))]) ipv4_address = forms.CharField( label=_('Address'), validators=[validators.validate_ipv4_address], required=False) @@ -74,7 +76,8 @@ class ConnectionForm(forms.Form): 'configuration from this network making it a client.'), box_name=_(cfg.box_name)), choices=[('auto', _('Automatic')), ('dhcp', _('Automatic, DHCP only')), - ('manual', _('Manual')), ('ignore', _('Ignore'))]) + ('manual', pgettext_lazy('Not automatically', 'Manual')), + ('ignore', _('Ignore'))]) ipv6_address = forms.CharField( label=_('Address'), validators=[validators.validate_ipv6_address], required=False) diff --git a/plinth/templates/help-menu.html b/plinth/templates/help-menu.html index 79a1b2e7d..ab54f353e 100644 --- a/plinth/templates/help-menu.html +++ b/plinth/templates/help-menu.html @@ -17,8 +17,8 @@