diff --git a/invenio_app_rdm/administration/records/records.py b/invenio_app_rdm/administration/records/records.py index 5eb699202..af33ef6cf 100644 --- a/invenio_app_rdm/administration/records/records.py +++ b/invenio_app_rdm/administration/records/records.py @@ -2,6 +2,7 @@ # # Copyright (C) 2023-2024 CERN. # Copyright (C) 2023 Graz University of Technology. +# Copyright (C) 2024 KTH Royal Institute of Technology. # # invenio-administration is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more @@ -21,11 +22,11 @@ class RecordAdminListView(AdminResourceListView): """Configuration for OAI-PMH sets list view.""" api_endpoint = "/records" - name = "Records" + name = "records" resource_config = "records_resource" search_request_headers = {"Accept": "application/vnd.inveniordm.v1+json"} - title = "Records" - category = "Records & files" + title = _("Records") + category = _("Records & files") icon = "file" template = "invenio_app_rdm/administration/records/records.html" extension_name = "invenio-rdm-records" @@ -99,11 +100,11 @@ class DraftAdminListView(AdminResourceListView): """Configuration for OAI-PMH sets list view.""" api_endpoint = "/user/records" - name = "Drafts" + name = "drafts" resource_config = "records_resource" search_request_headers = {"Accept": "application/vnd.inveniordm.v1+json"} - title = "Drafts" - category = "Records & files" + title = _("Drafts") + category = _("Records & files") icon = "upload" template = "invenio_app_rdm/administration/records/drafts.html" extension_name = "invenio-rdm-records" diff --git a/invenio_app_rdm/administration/user_moderation/user_moderation.py b/invenio_app_rdm/administration/user_moderation/user_moderation.py index 158016a17..c30f49144 100644 --- a/invenio_app_rdm/administration/user_moderation/user_moderation.py +++ b/invenio_app_rdm/administration/user_moderation/user_moderation.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2023-2024 CERN. +# Copyright (C) 2024 KTH Royal Institute of Technology. # # Invenio App RDM is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -13,6 +14,7 @@ AdminResourceDetailView, AdminResourceListView, ) +from invenio_i18n import lazy_gettext as _ from invenio_requests.customizations.user_moderation import UserModerationRequest from invenio_search_ui.searchconfig import search_app_config @@ -25,9 +27,9 @@ class UserModerationListView(AdminResourceListView): name = "moderation" resource_config = "requests_resource" request_headers = {"Accept": "application/vnd.inveniordm.v1+json"} - title = "Moderation" - menu_label = "Moderation" - category = "Moderation" + title = _("Moderation") + menu_label = _("Moderation") + category = _("Moderation") pid_path = "id" icon = "users" template = "invenio_app_rdm/administration/user_moderation.html" @@ -41,30 +43,30 @@ class UserModerationListView(AdminResourceListView): item_field_list = { # custom display of the values - only declared to create columns "expanded.topic.user": { - "text": "User", + "text": _("User"), "order": 2, "width": 4, }, # custom display of the values - only declared to create columns "expanded.topic.user.profile.email": { - "text": "Email", + "text": _("Email"), "order": 3, "width": 2, }, # custom display of the values - only declared to create columns "domain": { - "text": "Email domain", + "text": _("Email domain"), "order": 4, "width": 2, }, # custom display of the values - only declared to create columns "activity": { - "text": "Activity", + "text": _("Activity"), "order": 5, "width": 4, }, "status": { - "text": "Status", + "text": _("Status"), "order": 6, "width": 2, }, @@ -72,12 +74,12 @@ class UserModerationListView(AdminResourceListView): actions = { "accept": { - "text": "Approve", + "text": _("Approve"), "payload_schema": None, "order": 1, }, "decline": { - "text": "Block", + "text": _("Block"), "payload_schema": None, "order": 2, }, @@ -137,7 +139,7 @@ class UserModerationRequestDetailView(AdminResourceDetailView): api_endpoint = "/requests" name = "user-moderation-details" resource_config = "requests_resource" - title = "User moderation" + title = _("User moderation") display_delete = False display_edit = False @@ -160,14 +162,14 @@ def get_service_schema(cls): item_field_list = { "id": { - "text": "ID", + "text": _("ID"), "order": 1, }, "topic.user": { - "text": "User", + "text": _("User"), "order": 3, }, # TODO we should resolve the user. But this is fetched from the API. # TODO can we dereference somehow? - "created": {"text": "Created", "order": 2}, - "is_open": {"text": "Open", "order": 4}, + "created": {"text": _("Created"), "order": 2}, + "is_open": {"text": _("Open"), "order": 4}, } diff --git a/invenio_app_rdm/administration/users/users.py b/invenio_app_rdm/administration/users/users.py index 309ce648a..1e7844258 100644 --- a/invenio_app_rdm/administration/users/users.py +++ b/invenio_app_rdm/administration/users/users.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2023-2024 CERN. +# Copyright (C) 2024 KTH Royal Institute of Technology. # # Invenio App RDM is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -53,9 +54,9 @@ class UsersListView(AdminResourceListView): extension_name = "invenio-users-resources" name = "users" resource_config = "users_resource" - title = "User management" - menu_label = "Users" - category = "User management" + title = _("User management") + menu_label = _("Users") + category = _("User management") pid_path = "id" icon = "users" @@ -75,22 +76,22 @@ class UsersListView(AdminResourceListView): # TODO: missing permission based links in resource actions = { "approve": { - "text": "Approve", + "text": _("Approve"), "payload_schema": None, "order": 1, }, "restore": { - "text": "Restore", + "text": _("Restore"), "payload_schema": None, "order": 2, }, "block": { - "text": "Block", + "text": _("Block"), "payload_schema": None, "order": 2, }, "Deactivate": { - "text": "Suspend", + "text": _("Suspend"), "payload_schema": None, "order": 2, }, diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html index 3c7695aca..3963b6e21 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html @@ -4,6 +4,7 @@ Copyright (C) 2021-2023 TU Wien. Copyright (C) 2021 Graz University of Technology. Copyright (C) 2021 New York University. + Copyright (C) 2024 KTH Royal Institute of Technology. Invenio RDM Records is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. @@ -77,7 +78,7 @@
{% endif %} {% if community.parent %} -
{% if not is_draft %} diff --git a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html index 3945ea0d5..930161032 100644 --- a/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html +++ b/invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/access-form.html @@ -1,6 +1,9 @@ -{# Copyright (C) 2023 CERN. Invenio RDM Records is free software; you can redistribute -it and/or modify it under the terms of the MIT License; see LICENSE file for more -details. #} +{# + Copyright (C) 2023 CERN. + Copyright (C) 2024 KTH Royal Institute of Technology. + Invenio RDM Records is free software; you can redistribute it and/or modify + it under the terms of the MIT License; see LICENSE file for more details. +-#} {% from "invenio_accounts/_macros.html" import render_field, form_errors %} @@ -10,8 +13,8 @@ {% set full_name = None %}
- You are currently not logged in. Do you have an account? - Log in here + {{ _("You are currently not logged in") }}. {{ _("Do you have an account?") }} + {{ _("Log in here") }}
{% else %} {% set email = current_user.email %} @@ -24,8 +27,8 @@- Not you? - Log out to switch account. + {{ _("Not you?") }} + {{ _("Log out") }} {{ _("to switch account.") }}
{{ doi }}