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

[BUGFIX] Fix translations in deletion modals #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YKWeyer
Copy link

@YKWeyer YKWeyer commented Oct 27, 2023

When deleting a contentElement in the page module (TYPO3 11.5.32, GridElements 11.1.0), the confirmation modal doesn't respect the language settings of the user. It is also very unspecific, and doesn't explicitly confirm for deletion (and simply asks "Alert: are you sure?")

German English
image image

This seems to be caused by the Header.html templates, which tries to read a non-existing (or empty) property and falls back to TYPO3 JS defaults in english:

<a class="btn btn-default t3js-modal-trigger" href="{item.deleteUrl}"
  data-severity="warning"
  data-title="{item.deleteConfirmText}"
  data-content="{item.deleteConfirmText}"
  data-button-close-text="{item.deleteCancelText}"
  title="{item.deleteTitle}">

ℹ️ See the fallback chain in the Modal TypeScript:

const content = $element.data('bs-content') || $element.data('content') || 'Are you sure?';

I couldn't find anywhere, where deleteConfirmText, deleteTitle or deleteCancelText was being set (in both the GridElements extension and in the TYPO3 core), so I assume it was a copy/paste error, or it was an experiment which wasn't implemented until the end.

After fetching the translations from the backend extension, this is how it looks like:

German English
image image

ℹ️ the title and the content are twice the same in German, but this is due to the two strings label.confirm.delete_record.title and label.confirm.delete_record.content being identical in that locale.

@sypets
Copy link
Contributor

sypets commented Nov 22, 2023

There is already an issue open for this: #45

See also my PR #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants