User tests: Successful: Unsuccessful:
Currently we have a column for the language on all list views and a field to select the language on all edit views
This PR removes them when you are on a non multilingual site. This simplifies the UI and removes a useless field when creating content
You don't need to install multiple languages. It is enough to enable the System - Language Filter plugin.
When enabled you will have language columns, sorts and filters AND language fields on item creation
When not enabled you never see the language columns
Category | ⇒ | Administration com_banners com_categories com_contact com_content com_fields com_installer com_menus com_modules |
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Just a question. In the Html.php
files, you're using the following:
if (!\JLanguageMultilang::isEnabled())
{
unset($this->activeFilters['language']);
$this->filterForm->removeField('language', 'filter');
}
which unsets the language filters.
Rather than doing this, why not only set the language filters if a multilingual site is detected?
Surely this would reduce the amount of code that's being added, by only needing to add it in one place (perhaps JForm
), rather than every component.
Can't apply with eclipse the changes to com_tags/tmpl/tags/default.php
I have seen some other issues, like admin modules language field not displaying when editing such a module.
Going on my tests.
Concerning admin modules language field, the issue comes from
/layouts/joomla/edit/global.php
Where the language field is globally disabled, but should not for admin modules (when parameter set to yes).
It is easily solved in the layout by fetching com_modules params, but it would be an exception in a layout that is meant to be "Global".
@wilsonge
What do you think? We could maybe change the field name to lang
or adminlang
, modify related code and do the same in 3.8.0.
ADD: changing the field name is not enough it seems
Is missing in this PR the language assignment for the template styles.
When not multilang, we should have
diff --git a/administrator/components/com_templates/View/Style/Html.php b/administrator/components/com_templates/View/Style/Html.php
index fa9d411..7f1a3e0 100644
--- a/administrator/components/com_templates/View/Style/Html.php
+++ b/administrator/components/com_templates/View/Style/Html.php
@@ -72,4 +72,10 @@
}
+ if (!\JLanguageMultilang::isEnabled() && $this->item->client_id == 0)
+ {
+ $this->form->setFieldAttribute('home', 'type', 'radio');
+ $this->form->setFieldAttribute('home', 'class', 'switcher');
+ }
+
$this->addToolbar();
instead of
Thanks for your feedback - really helps - I will work through it all now and update the pr
@infograf768 has the code for the language field in the admin modules been merged?
@infograf768 I have made the change to the template as requested - thanks for the code.
For another PR but I guess that the template styles should be refactored to add a language column in the list view AND now that we have admin module language assignment there is no reason not to have admin template language assignment
For another PR but I guess that the template styles should be refactored to add a language column in the list view
It exists in the form of a Default
column where the lang flag is displayed if it exists.
Screenshot in staging (I am not on a specific OS with the right php version at the time of writing this)
For admin templates styles set to a specific language, that would be a new feature but it looks like it is first a matter of modifying the field in style_administrator.xml
and then make sure that value is used to load the right template depending on admin language.
For this PR, remains to solve the issue concerning admin modules language field.
Looking into it right now but we may need help on this.
Give me until tomorrow if no one finds a solution.
I have a solution by using a specific new layout admin_modules.php
in layout/joomla/edit/
Will post here tomorrow.
@brianteeman
Here we go.
Add this file, once decompressed, in layout/joomla/edit/
Then modify edit.php
diff --git a/administrator/components/com_modules/tmpl/module/edit.php b/administrator/components/com_modules/tmpl/module/edit.php
index e37a257..649bf58 100644
--- a/administrator/components/com_modules/tmpl/module/edit.php
+++ b/administrator/components/com_modules/tmpl/module/edit.php
@@ -149,5 +149,9 @@
?>
- <?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
+ <?php if ($this->item->client_id == 0) : ?>
+ <?php echo JLayoutHelper::render('joomla.edit.global', $this); ?>
+ <?php else : ?>
+ <?php echo JLayoutHelper::render('joomla.edit.admin_modules', $this); ?>
+ <?php endif; ?>
</div>
</div>
To test, set Language Filtering for administrator modules in Modules Options.
thanks - will look at it later today etc
To test, set Language Filtering for administrator modules in Modules Options.
That was the bit I was missing when I was trying to test this
@infograf768 can you confirm that administrator module language filtering is working BEFORE this PR. I see the option to enable it but it will not save a setting
I must misunderstand something about the admin module filtering because even with staging i dont see any difference to the admin modules
The difference when setting Language filtering to Yes is
Now, take for example the Logged-in Users
admin module and set its language to fr-FR (the language must be available in admin)
Look at Control Panel when you are using en-GB as back-end language.
The module does not display.
Change its language to All: it will display whatever the language.
Set its language to en-GB, it will display only when en-GB is back-end language.
You can manually install fr-fr by using this pack
http://joomlacode.org/gf/download/frsrelease/20459/164046/fr-FR_joomla_lang_full_3.7.5v2.zip
It contains a necessary correction for its fr-FR.localise.php concerning usage of JString
@infograf768 - silly me i didnt have a second language installed. Thanks for your patience I can proceed now
i suggest to add the code i proposed so that we can merge this before more changes in the modified files
@infograf768 why not add
if (!JModuleHelper::isAdminMultilang())
in the global layout?
@brianteeman
2 reasons:
if (!JModuleHelper::isAdminMultilang())
in global would help as it is totally independent from JLanguageMultilang::isEnabled()
.yes it is global and it makes sense to me to put it there it is DRY. we might even expand the usage of something like isAdminMultilang in the future such as templates
Yes i know they are not related. I think you misunderstood my comment
Yes i know they are not related. I think you misunderstood my comment
i think i did in fact. i even tried a few lines of code without any success as that conditional has to specifically target admin modules.
the solution i proposed is the only one i found. if we implement adminlanguage for backend templates and need a specific layout, then we will also have to add it. nothing wrong with that.
plus. in fact that for templates, it would be a new parameter and the helper would be the template helper and not the module helper...
Anything happening with this? Ready to test or still on discussion?
yes i have to fix the conflicts and one last filter. Its the work I was almost doing at the sprint until my laptop died.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-12-04 13:18:32 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_Date | 2017-12-04 13:18:32 | ⇒ | 2017-12-04 13:18:33 |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/17765
@infograf768 can you confirm you are happy with this now?