? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
9 May 2018

This is a redo of #13451 ### Summary of Changes

As discussed in #13421

Deprecate _QQ_ and normalize parsing of ini language files.

  • creates a new method JLanguageHelper::parseIniFile and marks LanguagesHelper::parseFile (helper of com_languages) as deprecated.
  • makes the necessary adaptations

Testing Instructions

  1. Apply patch

  2. Check all language strings show as usual. Including the ones with "_QQ_"

  3. Confirm language debug still works.
    Enable debug language in global config and system debug plugin.manually make some parsing errors in the en-GB.ini file and reload the page

  4. Confirm language overrrides still works.
    For instance, load a language string that uses escaped quotes (ex: JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED) and make some changes in the override. Save it and load it again to check if ok.

  5. Confirm quoting in server side and client side still works (ex: add to isis template index.php)

$app->enqueueMessage('Server side Test 1 (click to proceed to Client side Test 3): ' . JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'));
JText::script('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED');
$this->addScriptDeclaration("alert('Client side Test 1: ' + Joomla.JText._('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'));");
$this->addScriptDeclaration("alert('Client side Test 2: " . JText::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED', true) . "');");
$this->addScriptDeclaration("window.addEventListener('click', function () { Joomla.renderMessages({'error': ['Client side Test 3: ' + Joomla.JText._('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED')]}) });");
  1. Any other test you could remember

Documentation Changes Required

None

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
5.00

avatar brianteeman brianteeman - open - 9 May 2018
avatar brianteeman brianteeman - change - 9 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 May 2018
Category Administration com_languages Libraries
avatar infograf768
infograf768 - comment - 9 May 2018

Looks OK here for what it is supposed to do (tested all cases)

NOTE to @rdeutz while I think of it.
If I remember well, you are the one who made the patch to accept \" in core without triggering a debug error.
At that time, as we were just updating core to accept it ("_QQ_" had to be present twice in the value), we forced a double use of it (\"text\" is OK but a single \" IS triggering a debug error.

This is not necessary anymore for 4.0 where we will force the use of the escaped double quote everywhere.
Can you already think about getting rid of that limitation for 4.0?

avatar brianteeman
brianteeman - comment - 9 May 2018

please mark your test - thanks

avatar brianteeman brianteeman - change - 9 May 2018
Labels Added: ?
avatar ReLater ReLater - test_item - 9 May 2018 - Tested successfully
avatar ReLater
ReLater - comment - 9 May 2018

I have tested this item successfully on 724b56f


Nightly build 3.8.8-dev Wednesday, 09 May 2018 02:03:14 UTC.
Tested with no changes in language files.
Tested after replacement of "_QQ_" with \" in all language files.
Tested with and without Debug Language mode.
tested in FE and BE.
Tested with de-DE and en-GB.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20321.
avatar infograf768
infograf768 - comment - 11 May 2018

Waiting for the small changes pointed by @Quy to mark this as successful

96022c3 11 May 2018 avatar brianteeman c/s
avatar ReLater ReLater - test_item - 11 May 2018 - Tested successfully
avatar ReLater
ReLater - comment - 11 May 2018

I have tested this item successfully on 96022c3

After earlier successful test above this time only code review


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20321.

avatar infograf768 infograf768 - test_item - 12 May 2018 - Tested successfully
avatar infograf768
infograf768 - comment - 12 May 2018

I have tested this item successfully on 96022c3

looks fine to me. @mbabker please also test before merge.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20321.

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 12 May 2018

Ready to Commit after two successful tests.

avatar mbabker mbabker - change - 12 May 2018
Labels Added: ? ?
Removed: ?
avatar mbabker mbabker - change - 12 May 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-05-12 18:36:37
Closed_By mbabker
avatar mbabker mbabker - close - 12 May 2018
avatar mbabker mbabker - merge - 12 May 2018
avatar brianteeman
brianteeman - comment - 13 May 2018

thanks

avatar andrepereiradasilva
andrepereiradasilva - comment - 18 Jun 2018

Hi
@brianteeman beware hosts without parse_ini_file active will not be able to parse the language files.
Basicly the issue solved with #15620 and latter with wilh #17332 will happen again

avatar infograf768
infograf768 - comment - 18 Jun 2018

@mbabker
Don't know why, but I was thinking this would be for 4.0
@andrepereiradasilva is damned right. We have to deal with parse_ini as this is a 3.x release.

avatar brianteeman
brianteeman - comment - 18 Jun 2018

this is just a redo of @andrepereiradasilva original pr which needed a new owner. That pr was also was against staging

avatar infograf768
infograf768 - comment - 18 Jun 2018

His PR was done a long time ago ( #13451 ). The corrections were done after that pr was prepared.
Just look at the #

Basicly the issue solved with #15620 and latter with wilh #17332 will happen again

avatar mbabker
mbabker - comment - 18 Jun 2018

Should just be copying this block and replacing this line.

avatar infograf768
infograf768 - comment - 18 Jun 2018

@andrepereiradasilva

I see the code in Language.php here.
https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Language/Language.php#L832-L846
Are you sure it is missing somewhere?

avatar infograf768
infograf768 - comment - 18 Jun 2018

OK, this is for 3.9 as 3.8 is fine.
I do not have a 3.9 fork here atm, therefore someone has to create a PR towards 3.9

Add a Comment

Login with GitHub to post a comment