Skip to content

Commit

Permalink
Merge pull request #80 from oarepo/krist/be-497-user-reference-not-tr…
Browse files Browse the repository at this point in the history
…anslated-in-requests-ui-serialization

translations update
  • Loading branch information
mesemus authored Oct 31, 2024
2 parents 2b7f794 + b44b72c commit 64c32cc
Show file tree
Hide file tree
Showing 13 changed files with 275 additions and 140 deletions.
27 changes: 14 additions & 13 deletions oarepo_requests/resolvers/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
current_groups_service,
current_users_service,
)
from oarepo_runtime.i18n import gettext as _

from ..proxies import current_oarepo_requests
from ..utils import get_matching_service_for_refdict
Expand Down Expand Up @@ -105,13 +106,7 @@ def _search_one(self, identity, reference, *args, **kwargs):
return None

def _resolve(self, record, reference):
if record.data["name"] is None:
if "id" in record.data:
label = record.data["id"]
else:
label = fallback_label_result(reference)
else:
label = record.data["name"]
label = record.data["name"]
ret = {
"reference": reference,
"type": "group",
Expand Down Expand Up @@ -144,13 +139,19 @@ def _search_one(self, identity, reference, *args, **kwargs):
return None

def _resolve(self, record, reference):
if record.data["username"] is None: # username undefined?
if "email" in record.data:
label = record.data["email"]
else:
label = fallback_label_result(reference)
else:

if record.data["id"] == "system":
label = _("System user")
elif (
"profile" in record.data
and "full_name" in record.data["profile"]
and record.data["profile"]["full_name"]
):
label = record.data["profile"]["full_name"]
elif "username" in record.data and record.data["username"]:
label = record.data["username"]
else:
label = fallback_label_result(reference)
ret = {
"reference": reference,
"type": "user",
Expand Down
1 change: 1 addition & 0 deletions oarepo_requests/translations/_only_for_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
_("Submit event")
_("No requests to show")
_("api.requests")
_("api.applicable-requests")
Binary file modified oarepo_requests/translations/cs/LC_MESSAGES/messages.mo
Binary file not shown.
24 changes: 24 additions & 0 deletions oarepo_requests/translations/cs/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -624,3 +624,27 @@ msgstr "{{creatorLabel}} smazal(a) tuto žádost"

msgid "requestCommented"
msgstr "{{creatorLabel}} komentoval(a)"

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/delete_published_record.py:9
msgid "Permanently delete"
msgstr "Trvale smazat"

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/delete_published_record.py:20
msgid "Keep the record"
msgstr "Ponechat záznam"

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/publish_draft.py:36
msgid "Publish"
msgstr "Publikovat"

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/publish_draft.py:58
msgid "Return for correction"
msgstr "Vrátit k opravě"

#: /home/ron/prace/oarepo-requests/oarepo_requests/translations/_only_for_translations.py:33
msgid "api.applicable-requests"
msgstr "API pro vytváření žádostí"

#: /home/ron/prace/oarepo-requests/oarepo_requests/resolvers/ui.py:143
msgid "System user"
msgstr "Systémový uživatel"
Binary file modified oarepo_requests/translations/en/LC_MESSAGES/messages.mo
Binary file not shown.
24 changes: 24 additions & 0 deletions oarepo_requests/translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -589,5 +589,29 @@ msgstr "{{creatorLabel}} deleted this request"
msgid "requestCommented"
msgstr "{{creatorLabel}} commented"

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/delete_published_record.py:9
msgid "Permanently delete"
msgstr ""

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/delete_published_record.py:20
msgid "Keep the record"
msgstr ""

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/publish_draft.py:36
msgid "Publish"
msgstr ""

#: /home/ron/prace/oarepo-requests/oarepo_requests/actions/publish_draft.py:58
msgid "Return for correction"
msgstr ""

#: /home/ron/prace/oarepo-requests/oarepo_requests/resolvers/ui.py:143
msgid "System user"
msgstr ""

#: /home/ron/prace/oarepo-requests/oarepo_requests/translations/_only_for_translations.py:33
msgid "api.applicable-requests"
msgstr ""

#~ msgid "No status"
#~ msgstr ""
Binary file modified oarepo_requests/translations/messages.mo
Binary file not shown.
Loading

0 comments on commit 64c32cc

Please sign in to comment.