- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.7k
[4.0] New feature. Adding a multilingual sample data plugin #20711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ; 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." | 
There was a problem hiding this comment.
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." | 
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!" | 
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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. | 
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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 | 
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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 | 
There was a problem hiding this comment.
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. | 
There was a problem hiding this comment.
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. | 
There was a problem hiding this comment.
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' | 
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ) | 
There was a problem hiding this comment.
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; | ||
| } | ||
|  | ||
| /** | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align *
| Thanks for feedback. | 
| 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 | 
| 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. | 
| 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 😉 | 
| 
 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. | 
| I’m sure I speak for more than myself here, 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.  It’s one thing to disagree, ask
Allon how often I disagree with him; it’s another thing to insult or attack. On Mon, Jun 11, 2018 at 8:17 AM infograf768 ***@***.***> wrote:
 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.
 —
 You are receiving this because you commented.
 Reply to this email directly, view it on GitHub
 <#20711 (comment)>,
 or mute the thread
 <https://github.com/notifications/unsubscribe-auth/AAWfodAIdZsUQg78aK7fvWFEh8SlOiNcks5t7m3OgaJpZM4UiH6n>
 .
 -- 
- Michael Please pardon any errors, this message was sent from my iPhone. | 
| Let's forget about joomla 4 and revert everything back to joomla 1.0 | 
| 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. | 
| 
 Yes it's quite simple to do. One could add checks to the  I can see arguments for having it both ways (I actually asked JM about this detail during his development): 
 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." | 
There was a problem hiding this comment.
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
| When you install the other sample data plugin - Sample Blog - you have a working site with meaningful and helpful content | 
| The intention isn't to showcase anything beside having a working multilingual setup with associated sample menuitems, categories and articles. | 
| 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 | 
| 
 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. | 
| ; 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." | 
There was a problem hiding this comment.
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.
f9bdd75    to
    20e1ce2      
    Compare
  
    | 
 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. 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. | 
| 
 | 
| I am closing this. No use to explain the reason further. | 
| No not happy. It was a simple request to have this useful feature only
present when it is usable… On 12 June 2018 at 08:18, infograf768 ***@***.***> wrote:
 Closed #20711 <#20711>.
 —
 You are receiving this because your review was requested.
 Reply to this email directly, view it on GitHub
 <#20711 (comment)>, or mute
 the thread
 <https://github.com/notifications/unsubscribe-auth/ABPH8RxwGLNbZW3fNQbTvqtV0E655ynNks5t72s0gaJpZM4UiH6n>
 .
 -- 
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
https://brian.teeman.net/ <http://brian.teeman.net/> | 
| 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). | 
| Reopened as requested | 
5a95845    to
    0210d06      
    Compare
  
    | I have tested this item ✅ successfully on 41e95f2 I detected some issues which are unrelated to this PR: 
 | 
| 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. | 
| 
 That would make this plugin a bug squad testers only stuff. | 
| I'll do that PR tomorrow as requested (not because I'm in favor). Please discuss it then in that PR. | 
| See #20749 | 
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.