Issue Bug Closed

#79879Missing translations for modal cancel / close buttons

Alexander Stehlik 02/17/17, 12:50 updated 10/11/18, 15:49

Description

The cancel / close buttons of modals are not translated. Noticed in these use cases:

  • Moving a file in the file list
  • Reload required dialog of the form engine (e.g. when changing the page type)

Those problems seem to come from the typo3/sysext/backend/Resources/Public/JavaScript/Modal.js code.

Modal.confirm tries to use translations as defaults which do not exist:

text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',

The initialization for the .t3js-modal-trigger markup does not even try to use translations. It uses a hardcoded “close” string.

My suggestion so solve this issue would be:

  1. Add 'button.ok' and 'button.cancel to the TYPO3.lang array by default
  2. Use those translations in both modals as default fallback

I can provide a patch if you can point me to the place where I can add translations to TYPO3.lang by default. I do not want to put it in the PageRenderer.

Reviews 2