diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ed4b7571de273d1c687b568c076f6b2ae164c8cb..fba93f97786a187b55c1f0c32c3d4b38dacab943 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -4,11 +4,10 @@ Thanks for contributing to Hypha! Please ensure your contributions pass all necessary linting/testing and that the appropriate documentation has been updated. --> -## Description <!-- Describe briefly what your pull request changes. If this is resoving an issue, please specify below via "Fixes #<Github Issue ID>" --> -Fixes #ISSUEID. +Fixes #ISSUEID ## Test Steps @@ -21,4 +20,4 @@ Give a brief overview of the steps required for a user/dev to test this contribu - Langauge that can be understood by non-technical testers if being tested by users --> - - [ ] ... + - [ ] … diff --git a/hypha/apply/activity/models.py b/hypha/apply/activity/models.py index a94ddd3c6609b613c42f5268a800e305b4388e0e..d0fe8c36bc837f12d137f00aa2546c8b27b5f5cf 100644 --- a/hypha/apply/activity/models.py +++ b/hypha/apply/activity/models.py @@ -21,8 +21,8 @@ COMMENT = "comment" ACTION = "action" ACTIVITY_TYPES = { - COMMENT: "Comment", - ACTION: "Action", + COMMENT: _("Comment"), + ACTION: _("Action"), } # Visibility strings. Used to determine visibility states but are also diff --git a/hypha/apply/activity/templates/activity/notifications.html b/hypha/apply/activity/templates/activity/notifications.html index 130b90d030cd9bf6b10e7a76b32d3c71f00d63fd..83d511ac9c61150e6cb8bb26c66ed7d24e3645b9 100644 --- a/hypha/apply/activity/templates/activity/notifications.html +++ b/hypha/apply/activity/templates/activity/notifications.html @@ -71,7 +71,7 @@ {% if activity.related_object %} <p> <a href="{{ activity.related_object.get_absolute_url }}" class="uppercase font-bold hover:opacity-70 transition-opacity"> - <span>View {{ activity.related_object|model_verbose_name }}</span> + <span>{% trans "View" %} {{ activity.related_object|model_verbose_name }}</span> {% heroicon_outline "arrow-right" size=12 class="inline align-baseline" stroke_width=4 %} </a> </p> diff --git a/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html b/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html index 9a813a591eb94759b16a7cfeeacfa693ed7b6900..9ae7a0b1eba450f5541db9bbe014badbd547201f 100644 --- a/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html @@ -32,7 +32,7 @@ <div class="bg-white p-1 flex mb-1 items-center"> <svg class="icon icon--dashboard-tasks"><use xlink:href="#{{ task.icon }}"></use></svg> <div class="flex-1">{{ task.text|markdown|nh3 }}</div> - <a class="button button-primary m-2" href="{{ task.url }}">View</a> + <a class="button button-primary m-2" href="{{ task.url }}">{% trans "View" %}</a> </div> {% endfor %} </div> diff --git a/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html b/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html index 2054d55a80e8f99dc2aaf6ce2175210baea26a1c..70ed5fce2d8eefb535394ce6b91f0a43a327b3bf 100644 --- a/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/contracting_dashboard.html @@ -22,7 +22,7 @@ <div class="bg-white p-1 flex mb-1 items-center"> <svg class="icon icon--dashboard-tasks"><use xlink:href="#{{ task.icon }}"></use></svg> <div class="flex-1">{{ task.text|markdown|nh3 }}</div> - <a class="button button-primary m-2" href="{{ task.url }}">View</a> + <a class="button button-primary m-2" href="{{ task.url }}">{% trans "View" %}</a> </div> {% endfor %} </div> diff --git a/hypha/apply/dashboard/templates/dashboard/dashboard.html b/hypha/apply/dashboard/templates/dashboard/dashboard.html index 41667459240e08c359bc9263bb73b683d73639e9..be41c4c617577e3b3a9958ac80311eaae87ea9de 100644 --- a/hypha/apply/dashboard/templates/dashboard/dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/dashboard.html @@ -31,7 +31,7 @@ <div class="bg-white p-1 flex mb-1 items-center"> <svg class="icon icon--dashboard-tasks"><use xlink:href="#{{ task.icon }}"></use></svg> <div class="flex-1">{{ task.text|markdown|nh3 }}</div> - <a class="button button-primary m-2" href="{{ task.url }}">View</a> + <a class="button button-primary m-2" href="{{ task.url }}">{% trans "View" %}</a> </div> {% endfor %} </div> diff --git a/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html b/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html index 6320843ea76d50ecca0db23a4636d96b72bd3d66..dfc2298d3ec731ad8027276cb2acaa62df539b2c 100644 --- a/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/finance_dashboard.html @@ -22,7 +22,7 @@ <div class="bg-white p-1 flex mb-1 items-center"> <svg class="icon icon--dashboard-tasks"><use xlink:href="#{{ task.icon }}"></use></svg> <div class="flex-1">{{ task.text|markdown|nh3 }}</div> - <a class="button button-primary m-2" href="{{ task.url }}">View</a> + <a class="button button-primary m-2" href="{{ task.url }}">{% trans "View" %}</a> </div> {% endfor %} </div> diff --git a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html index 72e2d02a1884ce5ee23c6ada75ac8783e7fae144..59d3c93144704f340d2cea8cb3b24c71b99ea65b 100644 --- a/hypha/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/hypha/apply/funds/templates/funds/applicationsubmission_detail.html @@ -203,7 +203,7 @@ <div class="tabs__content" id="tab-3"> <div class="feed"> {% comment %} Loaded using the htmx via alpine's custom event "open-tab-3"{% endcomment %} - <p>Loading...</p> + <p>{% trans "Loading…" %}</p> </div> </div> </div> diff --git a/hypha/apply/funds/templates/funds/includes/reminders_block.html b/hypha/apply/funds/templates/funds/includes/reminders_block.html index a28b847270fadc576cc5393fd7a38b69961edf9a..96a2e502316dad9cb5c9d67d0d02b6a5d474c16c 100644 --- a/hypha/apply/funds/templates/funds/includes/reminders_block.html +++ b/hypha/apply/funds/templates/funds/includes/reminders_block.html @@ -17,7 +17,7 @@ </div> <a class="link reminder-delete" href="{% url 'funds:submissions:reminders:delete' object.id reminder.id %}"> {% heroicon_micro "trash" class="inline me-1 align-middle fill-red-500" aria_hidden=true %} - <span class="sr-only">Delete</span> + <span class="sr-only">{% trans "Delete" %}</span> </a> </li> {% endfor %} diff --git a/hypha/apply/funds/templates/funds/includes/submission-list-item.html b/hypha/apply/funds/templates/funds/includes/submission-list-item.html index 3f983a9fd58656c45ea5ca1638da259dda3dc636..65e947509dac67a710b43a0ae5d3ce2217fa0ff1 100644 --- a/hypha/apply/funds/templates/funds/includes/submission-list-item.html +++ b/hypha/apply/funds/templates/funds/includes/submission-list-item.html @@ -12,7 +12,7 @@ name="selectedSubmissionIds" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2" > - <span class="sr-only">Select submission #{{ s.id }}</span> + <span class="sr-only">{% trans "Select submission" %} #{{ s.id }}</span> </label> {% comment %} Screening, and Archived icons {% endcomment %} diff --git a/hypha/apply/funds/templates/funds/includes/table_filter_and_search.html b/hypha/apply/funds/templates/funds/includes/table_filter_and_search.html index cfe3373272ae7150e0efc7d8a7f9991cf968a9a9..f837c4bfe050073ed75af64ab09bbe007ba9ce8f 100644 --- a/hypha/apply/funds/templates/funds/includes/table_filter_and_search.html +++ b/hypha/apply/funds/templates/funds/includes/table_filter_and_search.html @@ -86,7 +86,7 @@ {% if use_search|default:False %} <form action="{{ search_action }}" method="get" role="search" class="form form--search-desktop"> <button class="button button--search" type="submit"> - <span class="sr-only">Search</span> + <span class="sr-only">{% trans "Search" %}</span> {% heroicon_mini "magnifying-glass" size=20 class="text-fg-muted" aria_hidden=true %} </button> {% if show_archive and archived_param is not None %} diff --git a/hypha/apply/funds/templates/submissions/all.html b/hypha/apply/funds/templates/submissions/all.html index 412f93e1cea410e0ec03c3c6564077e5d526c52f..6d36bd2c0ea4c07453e4ead81e08167712989f3e 100644 --- a/hypha/apply/funds/templates/submissions/all.html +++ b/hypha/apply/funds/templates/submissions/all.html @@ -73,7 +73,7 @@ type="search" id="search-navbar" class="block w-full p-2 ps-10 text-sm text-gray-900 border border-gray-300 rounded-sm bg-gray-50 focus:ring-blue-500 focus:border-blue-500" - placeholder="Search..." + placeholder="{% trans "Search…" %}" name="query" hx-trigger="search" hx-push-url="true" @@ -81,7 +81,7 @@ hx-include="input.js-filter-options:not([name=query])" hx-target="#main" hx-swap="outerHTML" - aria-label="{% trans 'Search Submissions' %}" + aria-label="{% trans 'Search submissions' %}" value="{{ search_query|default_if_none:'' }}" {% if search_query %}autofocus{% endif %} > </label> @@ -102,7 +102,7 @@ <div class="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600"> </div> - <span class="ms-3 text-sm font-medium text-gray-600">Archived</span> + <span class="ms-3 text-sm font-medium text-gray-600">{% trans "Archived" %}</span> </label> </span> {% endif %} @@ -123,7 +123,7 @@ class="inline-flex items-center px-2 py-1 me-2 text-xs font-medium text-blue-400 bg-blue-100 rounded hover:bg-blue-200 hover:text-blue-900" > {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove all filters</span> + <span class="sr-only">{% trans "Remove all filters" %}</span> </a> {% if selected_statuses %} @@ -131,7 +131,7 @@ status:{% for s in selected_statuses %}{{ s }}{% endfor %} <a href="{% remove_from_query "status" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Status Filter</span> + <span class="sr-only">{% trans "Remove status filter" %}</span> </a> </span> {% endif %} @@ -140,7 +140,7 @@ fund:{% for s in selected_fund_objects %}"{{ s }}"{% endfor %} <a href="{% remove_from_query "fund" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Fund Filter</span> + <span class="sr-only">{% trans "Remove fund filter" %}</span> </a> </span> {% endif %} @@ -149,7 +149,7 @@ round:{% for s in selected_round_objects %}"{{ s }}"{% endfor %} <a href="{% remove_from_query "round" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Round Filter</span> + <span class="sr-only">{% trans "Remove round filter" %}</span> </a> </span> {% endif %} @@ -158,7 +158,7 @@ Lead:{% for s in selected_leads %}{{ s }}{% endfor %} <a href="{% remove_from_query "lead" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Leads Filter</span> + <span class="sr-only">{% trans "Remove leads filter" %}</span> </a> </span> {% endif %} @@ -167,7 +167,7 @@ Applicant:{% for s in selected_applicants %}{{ s }}{% endfor %} <a href="{% remove_from_query "applicants" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Applicant Filter</span> + <span class="sr-only">{% trans "Remove applicant filter" %}</span> </a> </span> {% endif %} @@ -176,7 +176,7 @@ Reviewer:{{ s }} <a href="{% remove_from_query reviewers=s %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Reviewer filter</span> + <span class="sr-only">{% trans "Remove reviewer filter" %}</span> </a> </span> {% endfor %} @@ -185,7 +185,7 @@ Meta Term:{{ s }} <a href="{% remove_from_query meta_terms=s %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Meta Term filter</span> + <span class="sr-only">{% trans "Remove meta term filter" %}</span> </a> </span> {% endfor %} @@ -194,7 +194,7 @@ Category:{{ s.value }} <a href="{% remove_from_query category_options=s.id %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove category filter</span> + <span class="sr-only">{% trans "Remove category filter" %}</span> </a> </span> {% endfor %} @@ -203,7 +203,7 @@ screening:"{{ s.title }}" <a href="{% remove_from_query screening_statuses=s.slug %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove screening decisions filter</span> + <span class="sr-only">{% trans "Remove screening decisions filter" %}</span> </a> </span> {% endfor %} @@ -212,7 +212,7 @@ sort:{{ selected_sort }} <a href="{% remove_from_query "sort" %}" role="button" class="inline-flex items-center p-0.5 ms-1 text-xs text-blue-400 bg-transparent rounded-sm hover:bg-blue-200 hover:text-blue-900 dark:hover:bg-blue-800 dark:hover:text-blue-300" aria-label="Remove"> {% heroicon_mini "x-mark" aria_hidden="true" fill="currentColor" %} - <span class="sr-only">Remove Sort filter</span> + <span class="sr-only">{% trans "Remove sort filter" %}</span> </a> </span> {% endif %} @@ -276,7 +276,7 @@ <label for="id_select_all" x-show="!showSelectedSubmissions" - class="ms-2">Select all</label> + class="ms-2">{% trans "Select all" %}</label> <span x-cloak class="ms-2" x-show="showSelectedSubmissions"> <span x-text="selectedSubmissionCount"></span> selected</span> </span> @@ -463,8 +463,8 @@ {% include "funds/includes/submission-list-item.html" with s=s %} {% empty %} <div class="flex flex-col items-center justify-center py-20 px-4 border-t"> - <h2 class='text-2xl'>No results matched your search</h2> - <p>Try <a href="./" hx-get="./" hx-target="#main" hx-push-url="true" hx-swap="outerHTML">clearing</a> the current query and try again.</p> + <h2 class='text-2xl'>{% trans "No results matched your search" %}</h2> + <p>{% trans "Try" %} <a href="./" hx-get="./" hx-target="#main" hx-push-url="true" hx-swap="outerHTML">{% trans "clearing" %}</a> {% trans "the current query and try again" %}.</p> </div> {% endfor %} </section> @@ -473,7 +473,7 @@ <span class="step-links flex gap-2 justify-center items-center"> {% if page.has_previous %} <a href="?page=1" class="px-3 py-2 border hover:bg-slate-300">« First</a> - <a href="?page={{ page.previous_page_number }}" class="px-3 py-2 border hover:bg-slate-300">Previous</a> + <a href="?page={{ page.previous_page_number }}" class="px-3 py-2 border hover:bg-slate-300">{% trans "Previous" %}</a> {% endif %} <span class="current"> @@ -481,8 +481,8 @@ </span> {% if page.has_next %} - <a href="?page={{ page.next_page_number }}" class="px-3 py-2 border hover:bg-slate-300">Next</a> - <a href="?page={{ page.paginator.num_pages }}" class="px-3 py-2 border hover:bg-slate-300">Last »</a> + <a href="?page={{ page.next_page_number }}" class="px-3 py-2 border hover:bg-slate-300">{% trans "Next" %}</a> + <a href="?page={{ page.paginator.num_pages }}" class="px-3 py-2 border hover:bg-slate-300">{% trans "Last" %} »</a> {% endif %} </span> </nav> diff --git a/hypha/apply/funds/templates/submissions/submenu/rounds.html b/hypha/apply/funds/templates/submissions/submenu/rounds.html index cf6fa245b2db442776db49ee42864191edde9f63..acf20af3c04edc980b2f71e4fcc637490d62221a 100644 --- a/hypha/apply/funds/templates/submissions/submenu/rounds.html +++ b/hypha/apply/funds/templates/submissions/submenu/rounds.html @@ -25,14 +25,14 @@ <span @click="tab = 'closed_rounds'" role="tab" :class="{ 'border-x border-t border-b-transparent': tab === 'closed_rounds' }" - class="text-center bg-white inline-block px-4 py-2 border-b rounded-t-lg cursor-pointer hover:text-gray-900">Closed</span> + class="text-center bg-white inline-block px-4 py-2 border-b rounded-t-lg cursor-pointer hover:text-gray-900">{% trans "Closed" %}</span> {% endif %} {% if open_rounds %} <span @click="tab = 'open_rounds'" role="tab" :class="{ 'border-x border-t border-b-transparent': tab === 'open_rounds' }" - class="text-center bg-white inline-block px-4 py-2 border-b rounded-t-lg round cursor-pointer hover:text-gray-900">Open</span> + class="text-center bg-white inline-block px-4 py-2 border-b rounded-t-lg round cursor-pointer hover:text-gray-900">{% trans "Open" %}</span> {% endif %} </nav> diff --git a/hypha/apply/projects/forms/payment.py b/hypha/apply/projects/forms/payment.py index 8379e92de535512b7243fef996db491327a77b48..a68c9978fe8526b1598e2a57e7efa70f4b5af043 100644 --- a/hypha/apply/projects/forms/payment.py +++ b/hypha/apply/projects/forms/payment.py @@ -104,7 +104,9 @@ class InvoiceBaseForm(forms.ModelForm): class CreateInvoiceForm(FileFormMixin, InvoiceBaseForm): document = SingleFileField( - label="Invoice File", required=True, help_text=_("The invoice must be a PDF.") + label=_("Invoice file"), + required=True, + help_text=_("The invoice must be a PDF."), ) supporting_documents = MultiFileField( required=False, @@ -169,7 +171,7 @@ class EditInvoiceForm(FileFormMixin, InvoiceBaseForm): class SelectDocumentForm(forms.ModelForm): document = forms.ChoiceField( - label="Document", widget=forms.Select(attrs={"id": "from_submission"}) + label=_("Document"), widget=forms.Select(attrs={"id": "from_submission"}) ) class Meta: diff --git a/hypha/apply/projects/forms/project.py b/hypha/apply/projects/forms/project.py index 93ffb6be5cd62b4dd3d561c7623e9b1ad8465962..b341b31be2cf7973467f1f954fd71fdfac426e54 100644 --- a/hypha/apply/projects/forms/project.py +++ b/hypha/apply/projects/forms/project.py @@ -183,7 +183,7 @@ class ProjectSOWForm(StreamBaseForm, forms.ModelForm, metaclass=MixedMetaClass): class ChangePAFStatusForm(forms.ModelForm): name_prefix = "change_paf_status_form" paf_status = forms.ChoiceField( - label="PAF status", choices=PAF_STATUS_CHOICES, widget=forms.RadioSelect() + label=_("PAF status"), choices=PAF_STATUS_CHOICES, widget=forms.RadioSelect() ) comment = forms.CharField(required=False, widget=forms.Textarea) diff --git a/hypha/apply/projects/forms/report.py b/hypha/apply/projects/forms/report.py index 1a4d2c7f9d67fe23ca4d5e7af9a6358347b859fc..917ae5824cc29174cdf5f3eb3854626d598bdf39 100644 --- a/hypha/apply/projects/forms/report.py +++ b/hypha/apply/projects/forms/report.py @@ -23,7 +23,7 @@ class ReportEditForm(FileFormMixin, forms.ModelForm): widget=forms.CheckboxSelectMultiple(attrs={"class": "delete"}), queryset=ReportPrivateFiles.objects.all(), required=False, - label="Files", + label=_("Files"), ) files = MultiFileField(required=False, label="") diff --git a/hypha/apply/projects/forms/vendor.py b/hypha/apply/projects/forms/vendor.py index e3792d2f482aca01add4683c63d6ee70e3672e42..a6f12a56e62b2ef18970edad42747d12004470ba 100644 --- a/hypha/apply/projects/forms/vendor.py +++ b/hypha/apply/projects/forms/vendor.py @@ -66,7 +66,7 @@ class CreateVendorFormStep1(BaseVendorForm, forms.Form): class CreateVendorFormStep2(BaseVendorForm, forms.Form): required_to_pay_taxes = forms.TypedChoiceField( - choices=((False, "No"), (True, "Yes")), + choices=((False, _("No")), (True, _("Yes"))), coerce=lambda x: x == "True", widget=forms.RadioSelect, required=True, diff --git a/hypha/apply/projects/templates/application_projects/includes/contracting_documents.html b/hypha/apply/projects/templates/application_projects/includes/contracting_documents.html index 34fd7df579a7c1ba081d5559cb5b7a3b9064728e..0731c0c913f178d230d79dabf06ad278eb69a448 100644 --- a/hypha/apply/projects/templates/application_projects/includes/contracting_documents.html +++ b/hypha/apply/projects/templates/application_projects/includes/contracting_documents.html @@ -12,7 +12,7 @@ <button class="align-middle ms-1 transform transition-transform" x-bind:class="collapsed ? '': '-rotate-90' "> {% heroicon_outline 'chevron-left' size=20 stroke_width=2 aria_hidden=true %} - <span class="sr-only" x-text="collapsed ? 'expand' : 'collapse'">expand</span> + <span class="sr-only" x-text="collapsed ? 'expand' : 'collapse'">{% trans "expand" %}</span> </button> {% endif %} </div> diff --git a/hypha/apply/projects/templates/application_projects/includes/deliverables_block.html b/hypha/apply/projects/templates/application_projects/includes/deliverables_block.html index acb4a70421568d9c3843eb6cc89490dbcf4bd4fa..9fd55993428d41e77b5a3548f97d8b216573b015 100644 --- a/hypha/apply/projects/templates/application_projects/includes/deliverables_block.html +++ b/hypha/apply/projects/templates/application_projects/includes/deliverables_block.html @@ -37,7 +37,7 @@ </div> {% if invoice.deliverables_total_amount.total %} <div class="total"> - <b>...</b><br> + <b>…</b><br> <b>{% trans "Total:" %} {{ invoice.deliverables_total_amount.total|format_number_as_currency }}</b> </div> {% endif %} diff --git a/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html b/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html index d56a3d8842fa293806050a1d01bf911e34c9c688..a8613421cd3c7f7675a0608e472129384c57f467 100644 --- a/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html +++ b/hypha/apply/projects/templates/application_projects/includes/supporting_documents.html @@ -12,7 +12,7 @@ {% if collapsible_header %} <button class="align-middle ms-1 transform transition-transform" x-bind:class="collapsed ? '': '-rotate-90' "> {% heroicon_outline 'chevron-left' size=20 stroke_width=2 aria_hidden=true %} - <span class="sr-only" x-text="collapsed ? 'expand' : 'collapse'">expand</span> + <span class="sr-only" x-text="collapsed ? 'expand' : 'collapse'">{% trans "expand" %}</span> </button> {% endif %} </div> @@ -281,7 +281,7 @@ <p>{% trans "By default all the members are notified when an approver is not selected. Optionally, you may select specific approvers to assign and notify them." %}</p> <div class="flex items-center text-sm"> - <p class="flex-shrink font-bold text-slate-500 pe-2 mb-0">Optional</p> + <p class="flex-shrink font-bold text-slate-500 pe-2 mb-0">{% trans "Optional" %}</p> <p class="flex-grow h-px bg-mid-grey mb-0"></p> </div> diff --git a/hypha/apply/projects/templates/application_projects/invoice_detail.html b/hypha/apply/projects/templates/application_projects/invoice_detail.html index 8fde3b01276bd50a4fef5870f1d4ff81fcd6cb63..f939f73f84f0772128d5c52f49b0d883390b36b2 100644 --- a/hypha/apply/projects/templates/application_projects/invoice_detail.html +++ b/hypha/apply/projects/templates/application_projects/invoice_detail.html @@ -37,7 +37,7 @@ <span class="text-gray-400">{{ latest_activity.timestamp }}</span> {% if latest_activity_comment %} <svg class="icon icon--request-changes"><use xlink:href="#request-changes"></use></svg> - <a href="{% url 'apply:projects:detail' pk=object.project.id %}#communications#{{ latest_activity_comment.id }}" class="font-bold" target="_blank">View comment</a> + <a href="{% url 'apply:projects:detail' pk=object.project.id %}#communications#{{ latest_activity_comment.id }}" class="font-bold" target="_blank">{% trans "View comment" %}</a> {% endif %} </p> {% for activity in activities %} @@ -47,7 +47,7 @@ <span class="text-gray-400">{{ activity.timestamp }}</span> {% if activity_comment %} <svg class="icon icon--request-changes"><use xlink:href="#request-changes"></use></svg> - <a href="{% url 'apply:projects:detail' pk=object.project.id %}#communications#{{ activity_comment.id }}" class="font-bold" target="_blank">View comment</a> + <a href="{% url 'apply:projects:detail' pk=object.project.id %}#communications#{{ activity_comment.id }}" class="font-bold" target="_blank">{% trans "View comment" %}</a> {% endif %} </p> {% endfor %} diff --git a/hypha/apply/projects/templates/application_projects/paf_export.html b/hypha/apply/projects/templates/application_projects/paf_export.html index c5b3c55c1f0c2749929c88be345b75a76b77f4a9..62b9a044a920ce2daff8058b7926910370b5b111 100644 --- a/hypha/apply/projects/templates/application_projects/paf_export.html +++ b/hypha/apply/projects/templates/application_projects/paf_export.html @@ -1,3 +1,5 @@ +{% load i18n %} + <html> <head> <title>{{ title|default:"" }}</title> @@ -70,7 +72,7 @@ <p class="title"> <b>{{ org_name|upper }}</b> PROJECT APPROVAL FORM</p> </td> <td align="right" class="align-right"> - <b>Project Title</b> + <b>{% trans "Project title" %}</b> </td> </tr> <tr> @@ -80,7 +82,7 @@ </tr> <tr> <td align="right" class="align-right"> - <b>Project ID</b> + <b>{% trans "Project ID" %}</b> </td> </tr> <tr> @@ -111,7 +113,7 @@ <p>-</p> {% endif %} <!-- Supporting Documents with links--> - <p> <b>Supporting Documents </b></p> + <p> <b>{% trans "Supporting Documents" %}</b></p> {% if supporting_documents %} {% for document, document_link in supporting_documents.items %} <p><a href="{{ document_link }}">{{ document }}</a></p> @@ -120,7 +122,7 @@ <p>-</p> {% endif %} <!-- Submission title with link--> - <p><b>Submission</b></p> + <p><b>{% trans "Submission" %}</b></p> <p><a href="{{ submission_link }}">{{ submission }}</a></p> {%endblock%} @@ -131,7 +133,7 @@ {%block page_foot%} <table> <tr> - <td>Exported by {{ export_user }} on {{ export_date }}</td> + <td>{% blocktrans %}Exported by {{ export_user }} on {{ export_date }}{% endblocktrans %}</td> <td align="right"> Page: <pdf:pagenumber /> </td> diff --git a/hypha/apply/projects/templates/application_projects/project_detail.html b/hypha/apply/projects/templates/application_projects/project_detail.html index 125783eefbfacf9aeed0b36c8e847cc9181e94ae..ec2ae135d00624cf2b4f0c44430baae2b524ec98 100644 --- a/hypha/apply/projects/templates/application_projects/project_detail.html +++ b/hypha/apply/projects/templates/application_projects/project_detail.html @@ -198,7 +198,7 @@ <p class="sidebar__paf-approvals--approved m-0">{% trans "Request changes or more information by " %}{{ paf_approval.user }}</p> {% get_comment_for_requested_approval paf_approval as rejected_comment %} {% if rejected_comment %} - <a href="#communications#{{ rejected_comment.id }}" class="font-bold" target="_blank">View comment</a> + <a href="#communications#{{ rejected_comment.id }}" class="font-bold" target="_blank">{% trans "View comment" %}</a> {% endif %} </div> </div> @@ -236,7 +236,7 @@ <div class="tabs__content" id="tab-3"> <div class="feed"> {% comment %} Loaded using the htmx via alpine's custom event "open-tab-3"{% endcomment %} - <p>Loading...</p> + <p>{% trans "Loading…" %}</p> </div> </div> </div> diff --git a/hypha/apply/projects/templates/application_projects/sow_export.html b/hypha/apply/projects/templates/application_projects/sow_export.html index 7bbd83579613c8c7c059abad28e5d1075a971304..a4eb376237c94fa9b807be5ede585387c17862b5 100644 --- a/hypha/apply/projects/templates/application_projects/sow_export.html +++ b/hypha/apply/projects/templates/application_projects/sow_export.html @@ -1,3 +1,5 @@ +{% load i18n %} + <html> <head> <title>{{ title|default:"" }}</title> @@ -80,7 +82,7 @@ {%block page_foot%} <table> <tr> - <td>Exported by {{ export_user }} on {{ export_date }}</td> + <td>{% blocktrans %}Exported by {{ export_user }} on {{ export_date }}{% endblocktrans %}</td> <td align="right"> Page: <pdf:pagenumber /> </td> diff --git a/hypha/apply/projects/views/project.py b/hypha/apply/projects/views/project.py index c8c03844ed1751985b669b34d53f4344a19e8875..b43d9cd6e003e17d401e7d4f0ad711c033bd91f6 100644 --- a/hypha/apply/projects/views/project.py +++ b/hypha/apply/projects/views/project.py @@ -381,7 +381,7 @@ class UpdateLeadView(DelegatedViewMixin, UpdateView): request=self.request, user=self.request.user, source=project, - related=old_lead or "Unassigned", + related=old_lead or _("Unassigned"), ) messages.success( diff --git a/hypha/apply/projects/views/project_partials.py b/hypha/apply/projects/views/project_partials.py index 71598f2c57527dc7b02772b4115aec098d30eafb..a681399fe83ece4d0b1a5552e8711ed16c25ee6e 100644 --- a/hypha/apply/projects/views/project_partials.py +++ b/hypha/apply/projects/views/project_partials.py @@ -4,6 +4,7 @@ from django.contrib.auth.decorators import login_required from django.db.models import Count from django.shortcuts import get_object_or_404, render from django.urls import reverse_lazy +from django.utils.translation import gettext as _ from django.views.decorators.http import require_GET from hypha.apply.activity.services import ( @@ -60,7 +61,7 @@ def get_project_status_counts(request): "funds/includes/status-block.html", { "status_counts": status_counts, - "type": "Projects", + "type": _("Projects"), }, ) @@ -99,6 +100,6 @@ def get_invoices_status_counts(request): "funds/includes/status-block.html", { "status_counts": status_counts, - "type": "Invoices", + "type": _("Invoices"), }, ) diff --git a/hypha/apply/projects/views/vendor.py b/hypha/apply/projects/views/vendor.py index cb53405ce57746d78f8b6347513e13d1fda57033..315c3a2f6e45bbb025da1ba1309ab28c82f2e438 100644 --- a/hypha/apply/projects/views/vendor.py +++ b/hypha/apply/projects/views/vendor.py @@ -265,7 +265,7 @@ class VendorDetailView(DetailVendorAccessMixin, DetailView): vendor_form_settings.required_to_pay_taxes_label, vendor.required_to_pay_taxes, ), - ("Due Diligence Documents", ""), + (_("Due Diligence Documents"), ""), ] group = group + 1 data.setdefault( diff --git a/hypha/apply/users/templates/users/login.html b/hypha/apply/users/templates/users/login.html index 178814a0031becdf2c933291875b4ca65f0cb9f2..a9f8eed607c5e23e5b41b255ba2550e0a78862a9 100644 --- a/hypha/apply/users/templates/users/login.html +++ b/hypha/apply/users/templates/users/login.html @@ -17,11 +17,11 @@ <p>{% blocktrans trimmed %}We sent you a text message, please enter the tokens we sent.{% endblocktrans %}</p> {% else %} - <h2 class="text-2xl">Two Factor Verification</h2> + <h2 class="text-2xl">{% trans "Two factor verification" %}</h2> <p>{% blocktrans trimmed %}Please enter the 6-digit verification code generated by your Authenticator App.{% endblocktrans %}</p> {% endif %} {% elif wizard.steps.current == 'backup' %} - <h2 class="text-2xl">Two Factor Verification</h2> + <h2 class="text-2xl">{% trans "Two factor verification" %}</h2> <p> {% blocktrans trimmed %}Please enter one of the backup codes to login to your account.{% endblocktrans %} </p> @@ -42,7 +42,7 @@ } </style> - <h2 class="text-2xl">Log in to {{ ORG_SHORT_NAME }}</h2> + <h2 class="text-2xl">{% blocktrans %}Log in to {{ ORG_SHORT_NAME }}{% endblocktrans %}</h2> {% for field in form %} <div class="relative max-w-sm {% if field.auto_id == "id_auth-password" %}mb-4{% endif %}"> {% include "forms/includes/field.html" %} @@ -71,7 +71,7 @@ {% if GOOGLE_OAUTH2 %} <div class="flex items-center justify-start relative"> <hr class="inline w-32 h-px my-6 bg-gray-300 border-0"> - <span class="px-3 text-gray-400 font-medium">or</span> + <span class="px-3 text-gray-400 font-medium">{% trans "or" %}</span> <hr class="inline w-32 h-px my-6 bg-gray-300 border-0"> </div> diff --git a/hypha/apply/users/templates/users/partials/passwordless_login_signup_sent.html b/hypha/apply/users/templates/users/partials/passwordless_login_signup_sent.html index 5e356cc1f83b60d268cf51da4cc60aa78411a8ec..d0ad3892422e898fa3d7d9d59aa6b68a0f378399 100644 --- a/hypha/apply/users/templates/users/partials/passwordless_login_signup_sent.html +++ b/hypha/apply/users/templates/users/partials/passwordless_login_signup_sent.html @@ -23,7 +23,7 @@ </p> <p> - <a href="{% url 'users:passwordless_login_signup' %}{% if redirect_url %}?next={{ redirect_url }}{% endif %}" class="font-medium hover:underline">Try again</a> + <a href="{% url 'users:passwordless_login_signup' %}{% if redirect_url %}?next={{ redirect_url }}{% endif %}" class="font-medium hover:underline">{% trans "Try again" %}</a> </p> </section> {% endblock content %} diff --git a/hypha/apply/users/templates/users/password_reset/confirm.html b/hypha/apply/users/templates/users/password_reset/confirm.html index cfe71e554fa44d9219a6e4322e79b2e074058515..e51ba2dffad2658650a327269d61c3ba412b977e 100644 --- a/hypha/apply/users/templates/users/password_reset/confirm.html +++ b/hypha/apply/users/templates/users/password_reset/confirm.html @@ -8,7 +8,7 @@ <div class="wrapper max-w-xl mt-12"> {% if validlink %} - <h2 class="text-2xl">Reset Password</h2> + <h2 class="text-2xl">{% trans "Reset password" %}</h2> <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p> <form class="form" method="post" novalidate> @@ -44,7 +44,7 @@ </div> </form> {% else %} - <p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p> + <p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p> {% endif %} </div> {% endblock %} diff --git a/hypha/apply/users/templates/users/passwordless_login_signup.html b/hypha/apply/users/templates/users/passwordless_login_signup.html index 4fb5f44bd445b7c8195fdd2ac3a9a2f4e52e45b5..a8af8c41ab1ec12e619efbee62411c587584cc5b 100644 --- a/hypha/apply/users/templates/users/passwordless_login_signup.html +++ b/hypha/apply/users/templates/users/passwordless_login_signup.html @@ -14,7 +14,13 @@ <input type="hidden" name="next" value="{{ redirect_url }}"> {% endif %} - <h2 class="text-2xl">Login {% if ENABLE_PUBLIC_SIGNUP %}or Signup {% endif %}to {{ ORG_SHORT_NAME }}</h2> + <h2 class="text-2xl"> + {% if ENABLE_PUBLIC_SIGNUP %} + {% blocktrans %}Login or signup to {{ ORG_SHORT_NAME }}{% endblocktrans %} + {% else %} + {% blocktrans %}Login to {{ ORG_SHORT_NAME }}{% endblocktrans %} + {% endif %} + </h2> <div> {% for hidden in form.hidden_fields %} @@ -41,7 +47,7 @@ <div class="flex items-center justify-start relative mb-4"> <hr class="inline w-32 h-px my-6 bg-gray-300 border-0"> - <span class="px-3 text-gray-400 font-medium">or</span> + <span class="px-3 text-gray-400 font-medium">{% trans "or" %}</span> <hr class="inline w-32 h-px my-6 bg-gray-300 border-0"> </div> diff --git a/hypha/apply/users/templates/users/register.html b/hypha/apply/users/templates/users/register.html index 2728f6b8cd7cd5c12c8d4d2b51f5938cdee2f146..1b9b08de0b396b4a39cbfcf38bafc8487a8215ab 100644 --- a/hypha/apply/users/templates/users/register.html +++ b/hypha/apply/users/templates/users/register.html @@ -13,7 +13,7 @@ {% if redirect_url %} <input type="hidden" value="{{ redirect_url }}" name="next"> {% endif %} - <h2 class="text-2xl">Create your account</h2> + <h2 class="text-2xl">{% trans "Create your account" %}</h2> {% if form.non_field_errors %} <div class="wrapper wrapper--error">{{ form.non_field_errors.as_text }}</div> diff --git a/hypha/apply/users/templates/wagtailusers/users/index.html b/hypha/apply/users/templates/wagtailusers/users/index.html index f681270e045da8d26725355a58e3dacf27e81922..1cbca30a30afab55df5027f8682ba9dd2699172a 100644 --- a/hypha/apply/users/templates/wagtailusers/users/index.html +++ b/hypha/apply/users/templates/wagtailusers/users/index.html @@ -1,5 +1,5 @@ {% extends "wagtailusers/users/index.html" %} -{% load static %} +{% load static %} {% block extra_css %} <link rel="stylesheet" href="{% static 'css/wagtail_users_list.css' %}"> diff --git a/hypha/core/templates/components/dropdown-menu.html b/hypha/core/templates/components/dropdown-menu.html index 1f166f32a11adfeea5422cee6a7a29477ac610b9..8273639932944fd61d97307bf02b2057f1281307 100644 --- a/hypha/core/templates/components/dropdown-menu.html +++ b/hypha/core/templates/components/dropdown-menu.html @@ -1,4 +1,4 @@ -{% load heroicons %} +{% load heroicons i18n %} <div x-data="{ open: false, @@ -61,7 +61,7 @@ {% if attributes.enable_search %} <filter-input aria-owns="dd-content-{{ id }}" class='py-3 px-3 border-b flex grow'> - <label for="search-{{ id }}" class="sr-only">Filter {{ attributes.title }}</label> + <label for="search-{{ id }}" class="sr-only">{% trans "Filter" %} {{ attributes.title }}</label> <input type="text" autofocus id="search-{{ id }}" @@ -87,7 +87,7 @@ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill" /> </svg> - <span class="sr-only">Loading...</span> + <span class="sr-only">{% trans "Loading…" %}</span> </div> {% endif %} </div> diff --git a/hypha/templates/base-apply.html b/hypha/templates/base-apply.html index 72ae3df9b4eb70ffc474cf2572ef91a15ae8be38..89c4cc7899a07bbe19d9807017314b40c6d41c1f 100644 --- a/hypha/templates/base-apply.html +++ b/hypha/templates/base-apply.html @@ -4,7 +4,7 @@ {% block header %} <header class="header"> <div class="header__inner wrapper wrapper--large"> - <a href="{{ settings.utils.SystemMessagesSettings.site_logo_link|default:"/" }}" aria-label="Home link"> + <a href="{{ settings.utils.SystemMessagesSettings.site_logo_link|default:"/" }}" aria-label="{% trans "Home link" %}"> {% if settings.utils.SystemMessagesSettings.site_logo_default %} {% image settings.utils.SystemMessagesSettings.site_logo_default width-215 as logo_default %} <img class="header__logo header__logo--desktop" @@ -31,12 +31,12 @@ width="215" height="40" src="{% static 'images/logo.png' %}" - alt="Hypha logo" + alt="{% trans "Hypha logo" %}" > <img class="header__logo header__logo--mobile" width="60" height="60" src="{% static 'images/logo-small.png' %}" - alt="Hypha logo" + alt="{% trans "Hypha logo" %}" > {% endif %} </a> @@ -44,7 +44,7 @@ <div class="header__inner header__inner--mobile-buttons"> {% if request.user.is_authenticated %} <button class="button button--left-space js-mobile-menu-toggle" aria-haspopup="true"> - <span class="sr-only">{% trans "Open Menu" %}</span> + <span class="sr-only">{% trans "Open menu" %}</span> {% heroicon_outline "bars-3" size=32 stroke_width=2 class="inline" aria_hidden="true" %} </button> {% else %} @@ -78,7 +78,7 @@ width="60" height="60" src="{% static 'images/logo-small.png' %}" - alt="Hypha logo" + alt="{% trans "Hypha logo" %}" > {% endif %} </a> @@ -112,7 +112,7 @@ aria-haspopup="activity" aria-expanded="false" role="button" - title="Click to open your notifications" + title="{% trans "Click to open your notifications" %}" @click.prevent="open = ! open" > {% heroicon_outline "bell-alert" class="inline me-1 text-black" aria_hidden="true" %} diff --git a/hypha/templates/includes/messages.html b/hypha/templates/includes/messages.html index 000e8204de9e4616198cb65750b0a4e11bc79a0b..215580d0d6dffef8109006d973d093986e7d0488 100644 --- a/hypha/templates/includes/messages.html +++ b/hypha/templates/includes/messages.html @@ -1,4 +1,4 @@ -{% load heroicons %} +{% load heroicons i18n %} <ul class="messages"> {% for message in messages %} {% if 'project_action_message' in message.tags %} @@ -10,7 +10,7 @@ {% heroicon_outline "check" stroke_width=2 class="inline-block me-1 w-4 h-4" aria_hidden=true %} <p class="messages__copy">{{ message }}</p> <button type="button" class="p-2 hover:opacity-70" x-on:click="show = !show"> - <span class="sr-only">Close</span> + <span class="sr-only">{% trans "Close" %}</span> {% heroicon_outline "x-mark" stroke_width=2 class="inline" aria_hidden=true %} </button> </li>