Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n: add missing translation #2886

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions invenio_app_rdm/administration/records/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
32 changes: 17 additions & 15 deletions invenio_app_rdm/administration/user_moderation/user_moderation.py
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand All @@ -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"
Expand All @@ -41,43 +43,43 @@ 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,
},
}

actions = {
"accept": {
"text": "Approve",
"text": _("Approve"),
"payload_schema": None,
"order": 1,
},
"decline": {
"text": "Block",
"text": _("Block"),
"payload_schema": None,
"order": 2,
},
Expand Down Expand Up @@ -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
Expand All @@ -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},
}
15 changes: 8 additions & 7 deletions invenio_app_rdm/administration/users/users.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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"

Expand All @@ -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,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -77,7 +78,7 @@
<p class="ml-2 mb-0 display-inline-block"><i class="green check circle outline icon"></i></p>
{% endif %}
{% if community.parent %}
<div class="sub header">Part of
<div class="sub header">{{ _('Part of') }}
<a
href="{{ url_for('invenio_app_rdm_communities.communities_home', pid_value=community.parent.slug) }}">
{{community.parent.metadata.title}}
Expand Down Expand Up @@ -108,7 +109,7 @@
<div class="ui container">
<div class="header">
<i class="eye icon"></i>
<strong>{{ _ ("Preview") }}</strong>
<strong>{{ _("Preview") }}</strong>
</div>
<p>
{% if not is_draft %}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 %}

Expand All @@ -10,8 +13,8 @@
{% set full_name = None %}
<p class="rel-mb-2">
<i aria-hidden="true" class="user secret icon"></i>
<strong>You are currently not logged in</strong>. Do you have an account?
<a href="/login/">Log in here</a>
<strong>{{ _("You are currently not logged in") }}</strong>. {{ _("Do you have an account?") }}
<a href="/login/">{{ _("Log in here") }}</a>
</p>
{% else %}
{% set email = current_user.email %}
Expand All @@ -24,8 +27,8 @@ <h4>{{ _("You are logged in as") }}</h4>
</div>

<p class="mt-0 mb-10">
Not you?
<a href="{{ url_for('security.login') }}">Log out</a> to switch account.
{{ _("Not you?") }}
<a href="{{ url_for('security.login') }}">{{ _("Log out") }}</a> {{ _("to switch account.") }}
</p>
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{#
Copyright (C) 2020 CERN.
Copyright (C) 2020 Northwestern 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.
#}

<dd>
<a href="/coming-soon" class="ui button"><i class="envelope icon"></i> Send message</a>
<a href="/coming-soon" class="ui button"><i class="envelope icon"></i> {{ _("Send message") }}</a>
</dd>
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
Copyright (C) 2020 Northwestern University.
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.
#}

{% macro license_link(license) %}
{% if license.link %}
<a class="license-link" href="{{ license.link }}" target="_blank" title="{{ _('Opens in new tab') }}">Read more</a>
<a class="license-link" href="{{ license.link }}" target="_blank" title="{{ _('Opens in new tab') }}">{{ _('Read more') }}</a>
{% elif license.props and license.props.url %}
<a class="license-link" href="{{ license.props.url }}" target="_blank" title="{{ _('Opens in new tab') }}">Read more</a>
<a class="license-link" href="{{ license.props.url }}" target="_blank" title="{{ _('Opens in new tab') }}">{{ _('Read more') }}</a>
{% endif %}
{% endmacro %}


{% set rights = record.ui.get('rights') %}
{% if rights %}
<div class="sidebar-container">
Expand Down Expand Up @@ -55,9 +55,9 @@ <h2 class="ui medium top attached header mt-0">{{ _('Rights') }}</h2>

<div id="license-description-{{loop.index}}" class="description">
<span class="text-muted">
{{ license.description_l10n or _('No further description.')}}
{{ license.description_l10n or _('No further description.') }}
</span>
{{ license_link(license)}}
{{ license_link(license) }}
</div>
</div>
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{#
Copyright (C) 2020 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.
Expand All @@ -9,13 +10,13 @@
<div class="ui padded grid">
<div class="two column row version-first">
<div class="ten wide column left aligned">
<a href="">Version {{ version }}</a>
{% set doi = doi if doi else "No DOI available" %}
<a href="">{{ _("Version") }} {{ version }}</a>
{% set doi = doi if doi else _("No DOI available") %}
<p class="text-muted font-small">{{ doi }}</p>
</div>
<div class="six wide column right aligned">
<p class="text-muted font-small">{{ publication_date }}</p>
</div>
</div>
</div>
{%- endmacro %}
{%- endmacro %}
4 changes: 2 additions & 2 deletions invenio_app_rdm/records_ui/views/deposits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2019-2024 CERN.
# Copyright (C) 2019-2021 Northwestern University.
# Copyright (C) 2021 TU Wien.
# Copyright (C) 2022 KTH Royal Institute of Technology
# Copyright (C) 2022-2024 KTH Royal Institute of Technology
# Copyright (C) 2023 Graz University of Technology.
#
# Invenio App RDM is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -188,7 +188,7 @@ def subjects(self):
.options(load_only("id"))
.all()
)
limit_to = [{"text": "All", "value": "all"}]
limit_to = [{"text": _("All"), "value": "all"}]
# id is human readable and shorter, so we use it
limit_to += [{"text": s.id, "value": s.id} for s in subjects]

Expand Down
4 changes: 3 additions & 1 deletion invenio_app_rdm/records_ui/views/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (C) 2019-2024 CERN.
# Copyright (C) 2019-2020 Northwestern University.
# Copyright (C) 2021 TU Wien.
# 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.
Expand All @@ -16,6 +17,7 @@
from flask import current_app, url_for
from invenio_base.utils import obj_or_import_string
from invenio_i18n import get_locale
from invenio_i18n import lazy_gettext as _
from invenio_previewer.views import is_previewable
from invenio_records_files.api import FileObject
from invenio_records_permissions.policies import get_record_permission_policy
Expand Down Expand Up @@ -202,6 +204,6 @@ def transform_record(record, serializer, module=None, throws=True, **kwargs):
if throws:
raise Exception("No serializer found.")
except Exception:
current_app.logger.error("Record transformation failed.")
current_app.logger.error(_("Record transformation failed."))
if throws:
raise
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* // This file is part of Invenio-App-Rdm
* // Copyright (C) 2023 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.
Expand Down Expand Up @@ -72,7 +73,7 @@ export class ImpersonateUser extends Component {
labelPosition="left"
>
<Icon name="spy" />
Impersonate
{i18next.t("Impersonate")}
</Dropdown.Item>
<ActionModal modalOpen={modalOpen} user={user}>
{modalHeader && <Modal.Header>{modalHeader}</Modal.Header>}
Expand Down
Loading
Loading