User tests: Successful: Unsuccessful:
As discussed in #13421
This PR changes language overrides save to ini method so we use escaped double quotes (\"
) instead of "_QQ_"
.
Also adds a new method to save the language strings to a ini file so it can be easily used when needed.
"
). Save it, load it again and confirm if ok./administrator/language/overrides/en-GB.override.ini
. Example: A test with <a href=\"https://joomla.org\" target=\"_blank\">Joomla</a>
/administrator/language/overrides/en-GB.override.ini
with _QQ_
and escaped quotes. Example:JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED="A second test with <a href="_QQ_"https://joomla.org"_QQ_" target=\"_blank\">Joomla</a>"
// Server side message system
$app->enqueueMessage(JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'), 'warning');
// Client side message system (click on the page to show the javascript message)
JText::script('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED');
$this->addScriptDeclaration("document.addEventListener('click', function () { Joomla.renderMessages({'error': [Joomla.JText._('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED')]}) });");
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_languages Libraries |
I have tested this item
Code review OK
Status | Pending | ⇒ | Ready to Commit |
RTC
In any case, can you explain the reason for using addcslashes
instead of addslashes
?
warning concerning strings that would be used through js. see my comment in the specific pr.
Is not related to this PR.
In any case, can you explain the reason for using addcslashes instead of addslashes ?
because the only thing to escape are the double quotes ("
), ie, the ini string delimiters, the rest AFAIK is allowed in the ini file.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-01-04 07:19:38 |
Closed_By | ⇒ | rdeutz |
I have tested this item✅ successfully on 56d1bc0
Both
"_QQ_"
and\"
are being translated as expected and quotes in overrides save as\"
.This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13427.