Set a multilngual site including French Language.
Switch backend to French
Create a new menu item, set its content language to any language available.
Save (NOT Save and close).
Display the Associations tab
IN French the string is
COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE="- Pas d'association -"
The single quote is escaped in the display although it should not.
The code used is
$option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE');
@izharaazmi
Anyhting we can do?
The way these field are displayed is very different from the other components.
Labels |
Added:
?
|
@izharaazmi
I could use a real typographer quote ‘
But it does not solve the underlying issue.
Alright. I'd see what I can do.
Category | ⇒ | com_associations |
Status | New | ⇒ | Discussion |
It is not directly related to this one string and I suspect its either a field or JTEXT issue
As a test I made the following language overrides
| JGLOBAL_USE_GLOBAL | Use G'lobal
| JGLOBAL_USE_GLOBAL_VALUE | Use G'lobal (%s)
And as can be seen in the screenshot below depending this may cause issues as well.
the associations fields for menu items are not present in a xml. they are created on the fly as explained above. therefore it is not imho a JText issue but a result of the way Options are created.
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_menus/models/item.php#L1231-L1245
I think I found a solution, by not using the specific code
$option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE');
$option->addAttribute('value', '');
In that case, it is going to use the default
COM_MENUS_SELECT_A_MENUITEM
And then we need to change the JText from true to false in modal/menu.php
$title_holder = JText::_('COM_MENUS_SELECT_A_MENUITEM'); // instead of true.
in all places. It will take off the counterslash.
The patch could be more important than that though as we do have the possible same issue for modal fields elsewhere in code.
I guess it is better I do a single PR for this specific issue and then a global PR if necessary.
@izharaazmi
What do you think?
@infograf768 In current staging I get this.
I installed French language. Logout and logged in with French language selected. Created a new menu item with language = french and hit save (not close). I get this in the association tab.
Am I missing something?
Sorry, I missed that this is for 4.0. Testing again.
In fact it is even more simple.
We can keep the addchild code and then just take off true in modal/menu.php
Will do PR
@infograf768 Same result with 4.0-dev
@izharaazmi
I had changed in French the singlequote to Typographic quote, thus why you do not find the issue.
Making a PR now
and this is for staging :)
@izharaazmi @brianteeman
Please test
#19828
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-03-04 11:17:21 |
Closed_By | ⇒ | infograf768 |
@infograf768 Please see if using
'
helps. If not I'd look deeper.