? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
30 Jan 2020

Pull Request for Issue #27706 (comment).

Summary of Changes

Adds discover capability for languages installed in API directory.

Testing Instructions

Install these languages packs:
de-DE_joomla_lang_full_3.9.15v1-folders.zip
fr-FR_joomla_lang_full_3.9.15v1-zips.zip
Delete configuration.php file to reinstall Joomla.
Go to Extensions -> Discover.

Expected result

Site, administrator and API files discovered.

Actual result

Only site and administrator files discovered.

Documentation Changes Required

No.

avatar joomla-cms-bot joomla-cms-bot - change - 30 Jan 2020
Category Administration com_installer Language & Strings Libraries
avatar SharkyKZ SharkyKZ - open - 30 Jan 2020
avatar SharkyKZ SharkyKZ - change - 30 Jan 2020
Status New Pending
ec555b0 30 Jan 2020 avatar SharkyKZ CS
avatar SharkyKZ SharkyKZ - change - 30 Jan 2020
Labels Added: ? ?
avatar alikon
alikon - comment - 30 Jan 2020

Would we can do something similar for the CLI app ?

avatar SharkyKZ
SharkyKZ - comment - 30 Jan 2020

I guess. Personally, though, I'm not a fan of this duplicate file approach.

avatar infograf768
infograf768 - comment - 30 Jan 2020

Note: change in language packs format

The new J4 packs format will be (example with sub-zips fr-FR)
pkg_fr-FR.xml

	<files>
		<file type="language" client="site" id="fr-FR">site_fr-FR.zip</file>
		<file type="language" client="administrator" id="fr-FR">admin_fr-FR.zip</file>
		<file type="language" client="api" id="fr-FR">api_fr-FR.zip</file>
	</files>

The api_fr-FR.zip unzipped gives:
for the install.xml

	<files>
		<filename>fr-FR.ini</filename>
		<filename>fr-FR.lib_joomla.ini</filename>
		<filename>fr-FR.localise.php</filename>
		<filename file="meta">install.xml</filename>
		<filename file="meta">fr-FR.xml</filename>
		<filename>index.html</filename>
	</files>

Screen Shot 2020-01-30 at 09 08 29

index.html is no use, just a remaining of com_localise

The lang files will be modified in the future to not include the prefix.
fr-FR.xml = langmetadata.xml
fr-FR. ini => joomla.ini
fr-FR.foo.ini => foo.ini

avatar SharkyKZ
SharkyKZ - comment - 30 Jan 2020

@infograf768 Actually I don't know if this is the correct format or what files should be included for API. This is just for testing purposes.

avatar infograf768
infograf768 - comment - 30 Jan 2020

Understood that. It could be it's only joomla.ini (former fr-FR.ini).
The important is the new pack format which have to be used by TTs

avatar SharkyKZ
SharkyKZ - comment - 30 Jan 2020

Language class doesn't support API's localise.php yet. We should either add it there or remove from the language pack. Whatever George decides.

com_languages also needs adjustments.

avatar wilsonge
wilsonge - comment - 30 Jan 2020

Is there ever any difference between localise.php in the different envs? @infograf768 would you prefer to have it duplicated per application or have 1 per env to allow separate packs per application?

avatar infograf768
infograf768 - comment - 30 Jan 2020

I don't see why we would need separate packs per application. It would be a regression to not use a single pkg but single extension install as we did in 1.5 (see http://joomlacode.org/gf/project/jtranslation/frs/ )
The only reason we have 2 localise.php files was to allow some TTs to propose at least site translations in their package (plus some plugins lang files in the admin part as they are used in front.)
When included in both admin and site app, they should be exactly the same.
Similar reasons and behavior for the lib_joomla.ini

No idea if they should or not be present in api as I have no idea what that is for...

avatar richard67
richard67 - comment - 2 Feb 2020

@infograf768 Shall we test this PR as it is? Or does it need some changes?

avatar wilsonge
wilsonge - comment - 9 Feb 2020

@richard67 please test

avatar wilsonge
wilsonge - comment - 9 Feb 2020

@SharkyKZ We also need to fix this part

if ($client->name === 'administrator')
- there's no user api override right now (and there shouldn't be) so this part should be skipped if it's an API language pack

avatar wilsonge
wilsonge - comment - 9 Feb 2020

// Overwrite is set
// We didn't have overwrite set, find an update function or find an update tag so lets call it safe
if (file_exists($this->parent->getPath('extension_site')))
{
// If the site exists say so.
Log::add(
Text::sprintf('JLIB_INSTALLER_ABORT', Text::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_site'))),
Log::WARNING, 'jerror'
);
}
else
{
// If the admin exists say so.
Log::add(
Text::sprintf('JLIB_INSTALLER_ABORT',
Text::sprintf('JLIB_INSTALLER_ERROR_FOLDER_IN_USE', $this->parent->getPath('extension_administrator'))
),
Log::WARNING, 'jerror'
);
}
also needs adjusting for the API directory I guess?

avatar richard67
richard67 - comment - 9 Feb 2020

@wilsonge What now? Shall he fix that in a future PR and I shall test this? Or shall he fix that in this PR so I shall wait?

avatar wilsonge
wilsonge - comment - 9 Feb 2020

Needs fixes :) realised this after I posted. I mean this will fix discover but we may as well fix these other small things whilst we are at it

avatar richard67
richard67 - comment - 9 Feb 2020

Well it deals with discover, maybe that's why you discover things ?

avatar wilsonge
wilsonge - comment - 15 Feb 2020

@richard67 ready for testing

avatar richard67
richard67 - comment - 16 Feb 2020

I have tested this item successfully on 6b1ef87

Tested as following:

  1. Made a new, clean installation.
  2. Installed the 2 language packs from testing instructions.
  3. Deleted configuration.php and database tables and made again a new installation.
  4. Checked "Discover": Result: Of both language only admin and site were discovered.
  5. Applied the patch of this PR.
  6. Went again to discover view and used button "Discover" to force a new run. Result: Of both language admin, api and site were discovered.
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27711.
avatar richard67 richard67 - test_item - 16 Feb 2020 - Tested successfully
avatar richard67
richard67 - comment - 16 Feb 2020

@wilsonge Done.

avatar wilsonge wilsonge - change - 16 Feb 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-16 13:30:01
Closed_By wilsonge
avatar wilsonge wilsonge - close - 16 Feb 2020
avatar wilsonge wilsonge - merge - 16 Feb 2020
avatar wilsonge
wilsonge - comment - 16 Feb 2020

Thanks!

Add a Comment

Login with GitHub to post a comment