-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Multilingual: adding warning when changing item language. #12308
Conversation
The string is indeed wrong but I am not sure exactly what you mean. On 4 October 2016 at 17:08, infograf768 notifications@github.com wrote:
Brian Teeman |
"reset the available associations" sounds right. |
Reading your report more closely I think I understood it correctly On 4 October 2016 at 17:38, infograf768 notifications@github.com wrote:
Brian Teeman |
String modified. Thanks. |
i see here you are getting with this, but i think that's to much warnings for the user and it maybe could be done without any warnings. Example:
|
Concerning 1. we get this already before patch. If no one does it, this PR is better than nothing... |
Actually we don't. If we have a language selected that langiuage associations field/buttons is not rendered in the HTML so it can't be shown on change
I can help with that. something like this would work i think (just a PoC written directly with no test at all) jQuery(document).ready(function() {
jQuery('#jform_language').on('change' function() {
// Get the current selected language.
var selected = $(this).val();
// if the current selected is All languages hide the associations fields/buttons
if (selected == '*')
{
jQuery('#associations .control-group').hide();
}
else
{
// Show all associations fields/buttons.
jQuery('#associations .control-group').show();
// Remove the associations, ie, empty the associations fields and reset the buttons to Select/Create.
// [TODO]
// Now hide the ones not needed.
jQuery('#associations .control-group').each(function(index, element) {
var label = element.find('div.control-label label');
// Current selected language. Hide it.
if (label.attr("id") == 'jform_associations_' + selected.replace('-', '_') + '_id-lbl')
{
element.hide();
}
});
}
});
}); @jreys what do you think? |
8b2891c
to
67519c5
Compare
This branch has a booboo. Closing as Andre has anyway a much better solution |
Create a multingual site.
For example with 3 languages. Here I used en-GB, fr-FR and it-IT
Enable Associations in the language filter.
Create menu items, articles, contacts, newsfeeds, categories, assigning a specific Content Language to each of them. Save them without creating associations yet.
Edit one of these items (test on all kinds) tagged for example to en-GB.
Look at the Associations tab
The possible associations proposed are fr-FR and it-IT => OK
Change the language of the item, for example to fr-FR
DO NOT SAVE
Look again at the associations tab
The available associations are the same as before.
These should change to reflect the new language for the item.
I.e. we should get en-GB and it-IT
But as the original language value is set in the database, the item has to be saved BEFORE selecting/creating Associations.
Patch and test again.
This PR displays a message to let the user know the item has to be saved again before creating associations.
Note: It is normal, once associations are created, to not be able to change the language of the edited item.
@dgt41 @andrepereiradasilva @alikon
@brianteeman for the new string