Skip to content

Conversation

@infograf768
Copy link
Member

@infograf768 infograf768 commented Jun 11, 2018

Summary of Changes

Adding a Multilingual Sample Data plugin

Testing Instructions

Discover the plugin and enable it.
It will display in the Sample Data module in CPanel.
Make sure you do not have any sample data installed on your test site.
Make sure you have at least 2 languages installed and their Content Languages.
Launch the Multilingual Sample Data install

Expected result

The plugin will implement the 3.x multilang installation which could be done at Joomla install time and is no more available in 4.0 (although the code is still present in the installation folder and, I guess, should be deleted.).
It uses similar methods and obtains the same results.

It enables the Language Filter system plugin.
It creates a Language Switcher module.
It creates one Main Menu per language with a Blog menu item as Home + a hidden List All Categories menu item.
It creates the corresponding menu modules.
It creates one article category per language and one article tagged to the same language in each category.
Associations are set for menu items, categories and articles.

screen shot 2018-06-11 at 08 18 13

screen shot 2018-06-11 at 08 19 49

@infograf768 infograf768 requested a review from brianteeman as a code owner June 11, 2018 06:22
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels Jun 11, 2018
; Note : All ini files need to be saved as UTF-8

PLG_SAMPLEDATA_MULTILANG="Sample Data - Multilingual"
PLG_SAMPLEDATA_MULTILANG_MISSING_LANGUAGE="The site should have at least 2 languages andd their content languages installed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and not andd


PLG_SAMPLEDATA_MULTILANG="Sample Data - Multilingual"
PLG_SAMPLEDATA_MULTILANG_MISSING_LANGUAGE="The site should have at least 2 languages andd their content languages installed."
PLG_SAMPLEDATA_MULTILANG_OVERVIEW_DESC="Sample data which will set up a multilingual site.<br>Before launching, make sure you have at least 2 languages installed with their Content Languages and that no sample data has been installed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not detect if there are more than one language installed? That way we don't display this plugin to everyone and we dont need all of this message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description tells users not to install the plugin if there are less than 2 languages installed.
If they still do because they do not read the instructions, then we trigger the error.
We DO want to display the plugin to inform users that the site CAN be multilingual.
The plugin is enabled by default on a new Joomla install, it is disabled when we have an update, same as the other sampledata plugin. This is independent and should be such.

PLG_SAMPLEDATA_MULTILANG_STEP3_SUCCESS="Step 3: All Content Languages have been published!"
PLG_SAMPLEDATA_MULTILANG_STEP4_SUCCESS="Step 4: Specific Main Menus have been created as well as associated 'List All Categories' menu items!"
PLG_SAMPLEDATA_MULTILANG_STEP5_SUCCESS="Step 5: Specific Main Menus modules have been created!"
PLG_SAMPLEDATA_MULTILANG_STEP6_SUCCESS="Step 6: Categories, articles as well as 'Category Blog' menu items have been created and associated!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change "as well as" to "and"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

/**
* First step to enter the sampledata. Content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to "create" or "add" instead of "enter"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was just a copy/paste indeed of blog.php
Modified to fit the exact step1

}

/**
* Fourth step to create Menus and allcategories menu items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to two words "all categories"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

}

/**
* Sixth step to add categories, articles and blob menu items
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blob??



/**
* Seventh step to disable the mainmenu module which home page is set to All languages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change "which" to "whose"

}

/**
* Add AllCategories Menu Item for new router.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to two words "All Categories"


$data = array(
'title' => $title . ' (' . strtolower($itemLanguage->language) . ')',
'introtext' => '<p>Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan euripidis'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this not be a language string so that we can have real language specific dummy content and not pseudo latin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why force more translations? That is the way it was done in 3.x and it's real enough and fine for the purpose of this specific sampledata.


$languages = LanguageHelper::getContentLanguages(array(0, 1));

if (count($languages) < 2 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space after 2

return $response;
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align *

@infograf768
Copy link
Member Author

Thanks for feedback.

@brianteeman
Copy link
Contributor

This shouldn't be displayed on a single language site. If he only reason to do that is to let people know that joomla can be multilingual then we are really doing something very very wrong in telling people the features of joomla

@infograf768
Copy link
Member Author

Who the hell is going to know what are the intentions of a user installing Joomla for the first time? You? Mono or multilanguage? In 3.x was the same as here: user had the choice.
Your comment does not make sense and I think —as others around— that you are inded toxic. Period.

@mbabker
Copy link
Contributor

mbabker commented Jun 11, 2018

Unless we've removed the ability to install additional languages from the installer, by the time you reach the admin panel you should already be aware you can set up Joomla in a way to run its frontend in multiple languages. So I agree, this plugin doesn't need to show up in the dashboard module unless you've already set up multiple content languages or language packs or whatever the extra step is to make this actually be meaningful. Progressive disclosure, you know, that thing we've been begging to do for years with the toolbar 😉

@infograf768
Copy link
Member Author

by the time you reach the admin panel you should already be aware you can set up Joomla in a way to run its frontend in multiple languages.

Wrong. People may just want to install their language for a monolingual site use because English is NOT their lang of choice.

You people have decided to take off the possibility to set a test multiingual site at install time in a clear way. Take your responsibilities.

@mbabker
Copy link
Contributor

mbabker commented Jun 11, 2018 via email

@brianteeman
Copy link
Contributor

Let's forget about joomla 4 and revert everything back to joomla 1.0

@laoneo
Copy link
Member

laoneo commented Jun 11, 2018

Can we keep focus on the topic please. I agree here too, as long as there are no additional languages installed, it makes no sense to be able to see the installation link for multilingual. This should be possible in the plugin to detect.

@Bakual
Copy link
Contributor

Bakual commented Jun 11, 2018

This should be possible in the plugin to detect.

Yes it's quite simple to do. One could add checks to the onSampledataGetOverview() method in the plugin and return empty if it should not show.

I can see arguments for having it both ways (I actually asked JM about this detail during his development):

  • Having it always show means people see the possibility for such a sample installation is there. Once criteriums are met it even works. We currently only have one sampledata plugin installed, having it this way also makes clear that module is supposed to be a list, not a single "blog sampledata installation" module. It's also not like that list gets messy with two entries vs only the blog one.
  • Having it hidden is more like progressive disclosure. Michael is right in that and I can follow that argument as well (it was my inital thought after all). It's a bit different to the toolbar thought since in the toolbar you would see the buttons pop up as soon as you select something, whereas here you would not immediately see the result of adding a second content language. So it would look more like "magic" behaviour.

Personally I don't have strong feelings in any direction. But lets not shoot down this PR or make people angry just because of that tiny detail. Lets get it tested and merged since it is a needed and helpful feature. It would be easy enough to change after it is merged anyway.

PLG_SAMPLEDATA_MULTILANG_STEP4_SUCCESS="Step 4: Specific Main Menus have been created as well as associated 'List All Categories' menu items!"
PLG_SAMPLEDATA_MULTILANG_STEP5_SUCCESS="Step 5: Specific Main Menus modules have been created!"
PLG_SAMPLEDATA_MULTILANG_STEP6_SUCCESS="Step 6: Categories, articles and 'Category Blog' menu items have been created and associated!"
PLG_SAMPLEDATA_MULTILANG_STEP7_SUCCESS="Step 7: The Main Menu Module containing the Home menu item set to ALL languages has been unpublished!<br>Please reload this page."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "Please reload this page"

If it is really necessary then it should be in a block on its own so it can be easily seen

@brianteeman
Copy link
Contributor

When you install the other sample data plugin - Sample Blog - you have a working site with meaningful and helpful content
The same is not true for the sample data from this plugin. It is good for testing but it doesnt showcase anything

@Bakual
Copy link
Contributor

Bakual commented Jun 11, 2018

The intention isn't to showcase anything beside having a working multilingual setup with associated sample menuitems, categories and articles.
Which imho is a perfectly fine use of sample data.

@brianteeman
Copy link
Contributor

So maybe it should be called something other than sample then. Perhaps Example Setup

Anyway I just find it odd that the two plugins do not serve the same usecase

@Bakual
Copy link
Contributor

Bakual commented Jun 11, 2018

So maybe it should be called something other than sample then. Perhaps Example Setup

I don't mind how it is called. The module and plugins were written as a replacement for the sample data SQL files, but it can actually do whatever you want. Imho it also makes sense to be used for the multilingual setup.
To be fair, it's sort of a sample data as well, just a bit more sophisticated if you want. Using the term "sample data" a bit more broad.

; Note : All ini files need to be saved as UTF-8

PLG_SAMPLEDATA_MULTILANG="Sample Data - Multilingual"
PLG_SAMPLEDATA_MULTILANG_MISSING_LANGUAGE="The site should have at least 2 languages and their content languages installed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to
The site should have at least 2 languages installed and their content languages published.

@infograf768
Copy link
Member Author

but the way you voice your displeasure with changes being made in 4.0 far too often comes across as demeaning and borderline on the attack.

Yes, it is not even borderline, it is clear that I am quite pissed to see that some very useful features we took time (sometimes years) to get into Joomla are just thrown away in the dust bin without further discussion. And it is always the same people defending that policy who are also fighting against ways to make our CMS "great again" under the pretext that what is presented to them would be back to middle ages or whatever (read above).

Just reintroduce what we had when installing Joomla in 3.x which was chosing the admin and site default language and a basic multilang site and I would not have to propose such a PR as this one.
Taking that off WAS going back to joomla 1.0!!!

Evidently the easiest way for this plugin is simply to NOT enable it when installing a clean joomla site as we do when updating. This or waiting for a second language to be installed to be able to display it is totally useless in my opinion as new users would not even know there is this possibility or would already have created some data which would make this setting useless or broken.

In this case, better just close this PR.

@brianteeman
Copy link
Contributor

  1. No functionality is being removed. It is progressive disclosure just like other parts of Joomla.
  2. Installing multilingual sample data is not that old. IIRC it was not introduced until Javier was on gsoc
  3. No user who installed joomla using a webhost installer ever saw the options to install sample data before.
  4. Displaying every possible feature on the home page or they won't know it's possible is nonsensical Do we have the extension installer on the home page? Of course not because it lives in its own place. It doesn't need to be in the home page for people to know that you can install extensions.
  5. Having the option to install a configuration profile (it's not sample data) is great but if the first thing a user gets when the select it is an error message that's a bad first experience of Joomla.

@infograf768
Copy link
Member Author

I am closing this. No use to explain the reason further.
Happy?

@brianteeman
Copy link
Contributor

brianteeman commented Jun 12, 2018 via email

@Bakual
Copy link
Contributor

Bakual commented Jun 12, 2018

Since apparently JM isn't willing to adjust the code to Brians request, can we please reopen this PR and leave it as it, get it tested and merged. As I said before it's easy enough to do a follow up PR which changes that behaviour. It can then be discussed in that followup PR without this PR here being shut down due to childish behavior (and I think more than one acts childish here).

@brianteeman brianteeman reopened this Jun 12, 2018
@brianteeman
Copy link
Contributor

Reopened as requested

@Bakual
Copy link
Contributor

Bakual commented Jun 13, 2018

I have tested this item ✅ successfully on 41e95f2

The plugin works as expected and sets up a multilingual site with a sample articles, categories and menuitem for each installed language. All properly associated to eachother. Tested with three languages (english, french, german) after doscivering and enabling the plugin

I detected some issues which are unrelated to this PR:

@infograf768
Copy link
Member Author

Switching language doesn't directly switch to the associated article, instead goes back to the homepage.
Category edit form doesn't show association tab.

Some aspects are taken care of in a PR by @laoneo , remaining issues may be related tomodern routing in 4.0.
See: #20692

@laoneo
Copy link
Member

laoneo commented Jun 13, 2018

Ok, going to merge this one. Would be good if somebody can come up with a follow up pr which shows the sample data only when more than one language is installed. Thanks @infograf768 for patience and @brianteeman to raise awareness that it should be enable only when multiple languages are enabled.

@laoneo laoneo merged commit 5b04eea into joomla:4.0-dev Jun 13, 2018
@infograf768
Copy link
Member Author

Would be good if somebody can come up with a follow up pr which shows the sample data only when more than one language is installed.

That would make this plugin a bug squad testers only stuff.

@Bakual
Copy link
Contributor

Bakual commented Jun 13, 2018

I'll do that PR tomorrow as requested (not because I'm in favor). Please discuss it then in that PR.

@Bakual
Copy link
Contributor

Bakual commented Jun 14, 2018

See #20749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants