?
avatar chnnst
chnnst
25 Feb 2021

site Article frontend submit set default language

Testing instructions

monolingual site where back-end language English UI is used for the back-end part as default language

frontend language French

monolingual site where French UI is used for the site part as default language

Create menu item to set to use category and its subcategories and several other categories, but not all categories.

Let users submit articles from frontend only in French language

The problem is we get these options: All, English, French. And default is shown as All.

We want to see default language French as in this picture, but we get All.
1

Maybe someone knows where is this code ? In what file ? What line?
(What code makes default All, or French or English?)

new j3.24 site, default Protostar template

avatar chnnst chnnst - open - 25 Feb 2021
avatar joomla-cms-bot joomla-cms-bot - change - 25 Feb 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Feb 2021
avatar chnnst
chnnst - comment - 25 Feb 2021

Maybe we should update documentation on this , because no answer in forum.

avatar infograf768
infograf768 - comment - 25 Feb 2021

Where is your forum post?

avatar brianteeman
brianteeman - comment - 25 Feb 2021
  1. You have the language filter plugin enabled. For a monolingual site you do not need this - and this is the cause of all your problems
  2. Go to the installed languages page administrator/index.php?option=com_languages&view=installed and make sure that you have set French as the default language for the admin and english as the default language for the site
  3. unpublish the language switcher site module

Job done

avatar infograf768
infograf768 - comment - 25 Feb 2021

English for admin and French for site ;)
Also, once done , the language chosen in the Create article menu item is totally useless and will have no impact on your site.

avatar infograf768
infograf768 - comment - 25 Feb 2021

Then if you want your users to NOT be confused, make an override of /components/com_content/views/form/tmpl/edit.php
Modify

			<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'language', JText::_('JFIELD_LANGUAGE_LABEL')); ?>
				<?php echo $this->form->renderField('language'); ?>
			<?php echo JHtml::_('bootstrap.endTab'); ?>

with

			<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'language', JText::_('JFIELD_LANGUAGE_LABEL')); 			<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'language', JText::_('JFIELD_LANGUAGE_LABEL')); ?>
			<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'language', JText::_('JFIELD_LANGUAGE_LABEL')); ?>
				<?php $this->form->setFieldAttribute('language', 'default', 'fr-FR'); ?>
				<?php $this->form->setFieldAttribute('language', 'readonly', true); ?>
				<?php echo $this->form->renderField('language'); ?>
			<?php echo JHtml::_('bootstrap.endTab'); ?>
				<?php $this->form->setFieldAttribute('language', 'readonly', true); ?>
				<?php echo $this->form->renderField('language'); ?>
			<?php echo JHtml::_('bootstrap.endTab'); ?>

You will get
Screen Shot 2021-02-25 at 11 21 07

avatar chnnst
chnnst - comment - 25 Feb 2021

Language switcher site module is not created, do we need to create it ? and then unpublish?

It is set english as the default language for the admin and French as the default language for the site

I see:
Language Code is unpublished, do we need to enable it?
Language Filter is unpublished

Also I see Content languages
English is unpublished
French is published

avatar infograf768
infograf768 - comment - 25 Feb 2021
avatar drmenzelit
drmenzelit - comment - 25 Feb 2021

@chnnst check the plugin System - Language Filter, that should be disabled

avatar drmenzelit drmenzelit - change - 26 Feb 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-02-26 13:45:51
Closed_By drmenzelit
avatar drmenzelit drmenzelit - close - 26 Feb 2021
avatar drmenzelit
drmenzelit - comment - 26 Feb 2021

Closing this as it is not a bug. Feel free to ask for help in the forum.

Add a Comment

Login with GitHub to post a comment