From 8e14f78079feffa49daae44f6b52e1e540fb3871 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson <frjo@xdeb.org> Date: Wed, 9 Jun 2021 17:26:47 +0200 Subject: [PATCH] Make all heading translateble. --- hypha/apply/categories/models.py | 2 +- hypha/apply/determinations/models.py | 10 +++++----- hypha/apply/funds/models/applications.py | 16 ++++++++-------- hypha/apply/funds/models/utils.py | 4 ++-- hypha/public/home/models.py | 12 ++++++------ hypha/public/people/models.py | 4 ++-- hypha/public/projects/models.py | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/hypha/apply/categories/models.py b/hypha/apply/categories/models.py index 6496d3bcd..c04c25d91 100644 --- a/hypha/apply/categories/models.py +++ b/hypha/apply/categories/models.py @@ -82,7 +82,7 @@ class MetaTerm(index.Indexed, MP_Node): FieldPanel('available_to_applicants'), FieldPanel('help_text'), ], - heading="Options", + heading=_('Options'), ), ] diff --git a/hypha/apply/determinations/models.py b/hypha/apply/determinations/models.py index 4b72205b3..faa8a69ba 100644 --- a/hypha/apply/determinations/models.py +++ b/hypha/apply/determinations/models.py @@ -222,9 +222,9 @@ class DeterminationMessageSettings(BaseSetting): ] edit_handler = TabbedInterface([ - ObjectList(request_tab_panels, heading='Request'), - ObjectList(concept_tab_panels, heading='Concept note'), - ObjectList(proposal_tab_panels, heading='Proposal'), + ObjectList(request_tab_panels, heading=_('Request')), + ObjectList(concept_tab_panels, heading=_('Concept note')), + ObjectList(proposal_tab_panels, heading=_('Proposal')), ]) @@ -344,6 +344,6 @@ class DeterminationFormSettings(BaseSetting): ] edit_handler = TabbedInterface([ - ObjectList(concept_help_text_tab_panels, heading='Concept form'), - ObjectList(proposal_help_text_tab_panels, heading='Proposal form'), + ObjectList(concept_help_text_tab_panels, heading=_('Concept form')), + ObjectList(proposal_help_text_tab_panels, heading=_('Proposal form')), ]) diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py index 347a5aaf4..095ef27e6 100644 --- a/hypha/apply/funds/models/applications.py +++ b/hypha/apply/funds/models/applications.py @@ -123,9 +123,9 @@ class ApplicationBase(EmailForm, WorkflowStreamForm): # type: ignore ] edit_handler = TabbedInterface([ - ObjectList(content_panels, heading='Content'), + ObjectList(content_panels, heading=_('Content')), EmailForm.email_tab, - ObjectList(WorkflowStreamForm.promote_panels, heading='Promote'), + ObjectList(WorkflowStreamForm.promote_panels, heading=_('Promote')), ]) @@ -183,9 +183,9 @@ class RoundBase(WorkflowStreamForm, SubmittableStreamForm): # type: ignore FieldPanel('start_date'), FieldPanel('end_date'), ]), - ], heading="Dates"), + ], heading=_('Dates')), FieldPanel('reviewers', widget=forms.SelectMultiple(attrs={'size': '16'})), - ReadOnlyPanel('get_workflow_name_display', heading="Workflow", help_text=_('Copied from the fund.')), + ReadOnlyPanel('get_workflow_name_display', heading=_('Workflow'), help_text=_('Copied from the fund.')), # Forms comes from parental key in models/forms.py ReadOnlyInlinePanel('forms', help_text=_('Copied from the fund.')), ReadOnlyInlinePanel('review_forms', help_text=_('Copied from the fund.')), @@ -193,8 +193,8 @@ class RoundBase(WorkflowStreamForm, SubmittableStreamForm): # type: ignore ] edit_handler = TabbedInterface([ - ObjectList(content_panels, heading='Content'), - ObjectList(SubmittableStreamForm.promote_panels, heading='Promote'), + ObjectList(content_panels, heading=_('Content')), + ObjectList(SubmittableStreamForm.promote_panels, heading=_('Promote')), ]) def get_template(self, request, *args, **kwargs): @@ -431,9 +431,9 @@ class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm): # type: ig ] edit_handler = TabbedInterface([ - ObjectList(content_panels, heading='Content'), + ObjectList(content_panels, heading=_('Content')), EmailForm.email_tab, - ObjectList(WorkflowStreamForm.promote_panels, heading='Promote'), + ObjectList(WorkflowStreamForm.promote_panels, heading=_('Promote')), ]) def detail(self): diff --git a/hypha/apply/funds/models/utils.py b/hypha/apply/funds/models/utils.py index 45438dbcd..54b253f16 100644 --- a/hypha/apply/funds/models/utils.py +++ b/hypha/apply/funds/models/utils.py @@ -146,8 +146,8 @@ class EmailForm(AbstractEmailForm): FieldPanel('subject'), FieldPanel('confirmation_text_extra'), ], - heading="Confirmation email", + heading=_('Confirmation email'), ) ] - email_tab = ObjectList(email_confirmation_panels, heading='Confirmation email') + email_tab = ObjectList(email_confirmation_panels, heading=_('Confirmation email')) diff --git a/hypha/public/home/models.py b/hypha/public/home/models.py index f86a8c9f1..cb1400819 100644 --- a/hypha/public/home/models.py +++ b/hypha/public/home/models.py @@ -104,37 +104,37 @@ class HomePage(BasePage): FieldPanel('strapline'), PageChooserPanel('strapline_link'), FieldPanel('strapline_link_text'), - ], heading='Introduction'), + ], heading=_('Introduction')), MultiFieldPanel([ FieldPanel('news_title'), PageChooserPanel('news_link'), FieldPanel('news_link_text'), - ], heading='News'), + ], heading=_('News')), MultiFieldPanel([ FieldPanel('our_work_title'), StreamFieldPanel('our_work'), PageChooserPanel('our_work_link'), FieldPanel('our_work_link_text'), - ], heading='Our Work'), + ], heading=_('Our Work')), MultiFieldPanel([ FieldPanel('funds_title'), FieldPanel('funds_intro'), InlinePanel('promoted_funds', label=_('Promoted Funds'), max_num=NUM_RELATED), PageChooserPanel('funds_link'), FieldPanel('funds_link_text'), - ], heading='Funds'), + ], heading=_('Funds')), MultiFieldPanel([ FieldPanel('labs_title'), FieldPanel('labs_intro'), InlinePanel('promoted_labs', label=_('Promoted Labs'), max_num=NUM_RELATED), PageChooserPanel('labs_link'), FieldPanel('labs_link_text'), - ], heading='Labs'), + ], heading=_('Labs')), MultiFieldPanel([ FieldPanel('rfps_title'), FieldPanel('rfps_intro'), InlinePanel('promoted_rfps', label=_('Promoted RFPs'), max_num=NUM_RELATED), - ], heading='Labs'), + ], heading=_('Labs')), ] def get_related(self, page_type, base_list): diff --git a/hypha/public/people/models.py b/hypha/public/people/models.py index 73a974855..1c0c3132c 100644 --- a/hypha/public/people/models.py +++ b/hypha/public/people/models.py @@ -177,7 +177,7 @@ class PersonPage(FundingMixin, BasePage): MultiFieldPanel([ FieldPanel('first_name'), FieldPanel('last_name'), - ], heading="Name"), + ], heading=_('Name')), FieldPanel('active'), ImageChooserPanel('photo'), FieldPanel('job_title'), @@ -186,7 +186,7 @@ class PersonPage(FundingMixin, BasePage): MultiFieldPanel([ FieldPanel('email'), InlinePanel('contact_details', label=_('Other Contact Methods')), - ], heading='Contact information'), + ], heading=_('Contact information')), InlinePanel('person_types', label=_('Person types')), FieldPanel('introduction'), StreamFieldPanel('biography'), diff --git a/hypha/public/projects/models.py b/hypha/public/projects/models.py index 96180d29d..b37c9400a 100644 --- a/hypha/public/projects/models.py +++ b/hypha/public/projects/models.py @@ -131,7 +131,7 @@ class ProjectPage(FundingMixin, BasePage): InlinePanel('related_pages', label=_('Related Projects')), MultiFieldPanel( [FieldPanel('categories', widget=CategoriesWidget)], - heading="Categories", + heading=_('Categories'), classname="collapsible collapsed", ), ] -- GitLab