Skip to content

Commit

Permalink
i18n: mark missing translations for admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Jan 30, 2025
1 parent 2669e2d commit 0fd57e8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions invenio_administration/marshmallow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#
# This file is part of Invenio.
# Copyright (C) 2022-2024 CERN.
# Copyright (C) 2023 KTH Royal Institute of Technology.
# Copyright (C) 2023-2024 KTH Royal Institute of Technology.
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Invenio administration marshmallow utils module."""
import marshmallow
from invenio_i18n import lazy_gettext as _
from marshmallow import fields
from marshmallow_utils import fields as invenio_fields
from marshmallow_utils.fields import EDTFDateString, EDTFDateTimeString
Expand Down Expand Up @@ -64,7 +65,7 @@ def find_type_in_mapping(field_type, custom_mapping):
return custom_mapping[current_type]
current_type = current_type.__base__

raise KeyError(f"Unrecognized field type: {field_type}")
raise KeyError(_("Unrecognized field type: {field_type}", field_type=field_type))


def jsonify_schema(schema):
Expand Down Expand Up @@ -159,6 +160,12 @@ def jsonify_schema(schema):
}
)
except KeyError:
raise Exception(f"Unrecognised schema field {field}: {field_type_name}")
raise Exception(
_(
"Unrecognised schema field {field}: {field_type_name}",
field=field,
field_type_name=field_type_name,
)
)

return schema_dict

0 comments on commit 0fd57e8

Please sign in to comment.