? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
20 Jan 2017

Since the merge of the Custom fields plugins, these strings are no use in com_fields.ini

-COM_FIELDS_TYPE_CALENDAR="Calendar"
-COM_FIELDS_TYPE_CAPTCHA="CAPTCHA"
-COM_FIELDS_TYPE_CHECKBOXES="Checkboxes"
-COM_FIELDS_TYPE_COLOR="Colour"
-COM_FIELDS_TYPE_EDITOR="Editor"
-COM_FIELDS_TYPE_EMAIL="Email"
-COM_FIELDS_TYPE_IMAGELIST="Image"
-COM_FIELDS_TYPE_INTEGER="Integer"
-COM_FIELDS_TYPE_LIST="List"
-COM_FIELDS_TYPE_MEDIA="Media"
-COM_FIELDS_TYPE_RADIO="Radio"
-COM_FIELDS_TYPE_SQL="SQL"
-COM_FIELDS_TYPE_TEL="Telephone"
-COM_FIELDS_TYPE_TEXT="Text"
-COM_FIELDS_TYPE_TEXTAREA="Textarea"
-COM_FIELDS_TYPE_TIMEZONE="Timezone"
-COM_FIELDS_TYPE_URL="URL"
-COM_FIELDS_TYPE_USER="User"
-COM_FIELDS_TYPE_USERGROUPLIST="Usergroup"

@Bakual @laoneo

Also, the following strings are not displayed anywhere here:

COM_FIELDS_GROUP_PERMISSION_CREATE_DESC="New setting for <strong>create actions</strong> in this field group and the calculated setting based on the parent extension permissions."
COM_FIELDS_GROUP_PERMISSION_DELETE_DESC="New setting for <strong>delete actions</strong> on this field group and the calculated setting based on the parent extension permissions."
COM_FIELDS_GROUP_PERMISSION_EDITOWN_DESC="New setting for <strong>edit own actions</strong> on this field group and the calculated setting based on the parent extension permissions."
COM_FIELDS_GROUP_PERMISSION_EDITSTATE_DESC="New setting for <strong>edit state actions</strong> on this field group and the calculated setting based on the parent extension permissions."
COM_FIELDS_GROUP_PERMISSION_EDITVALUE_DESC="Who can edit the field value in the form editor."
COM_FIELDS_GROUP_PERMISSION_EDIT_DESC="New setting for <strong>edit actions</strong> on this field group and the calculated setting based on the parent extension permissions."

and

COM_FIELDS_FIELD_PERMISSION_DELETE_DESC="New setting for <strong>delete actions</strong> on this field and the calculated setting based on the parent extension and group permissions."
COM_FIELDS_FIELD_PERMISSION_EDITSTATE_DESC="New setting for <strong>edit state actions</strong> on this field and the calculated setting based on the parent extension and group permissions."
COM_FIELDS_FIELD_PERMISSION_EDITVALUE_DESC="Who can edit the custom field value in the form editor."
COM_FIELDS_FIELD_PERMISSION_EDIT_DESC="New setting for <strong>edit actions</strong> on this field and the calculated setting based on the parent extension and group permissions."

What you think?

avatar infograf768 infograf768 - open - 20 Jan 2017
avatar infograf768 infograf768 - change - 20 Jan 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2017
Category Administration Language & Strings
avatar Bakual
Bakual - comment - 20 Jan 2017

First group looks like it was forgotten in the PR. They are fine to be removed.

The other strings are used in the permission tab of the fields and field groups.

avatar Bakual Bakual - change - 20 Jan 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-01-20 14:10:53
Closed_By Bakual
Labels Added: ? ?
avatar Bakual Bakual - close - 20 Jan 2017
avatar Bakual Bakual - merge - 20 Jan 2017
avatar Bakual
Bakual - comment - 20 Jan 2017

Merged by review

avatar N6REJ
N6REJ - comment - 20 Jan 2017

@infograf768 you need to relook @ this jm.. at leas the last 2 groups are actually used by "access.xml" for the core.delete action and others.
Bear

On 20-Jan-17 08:10, Thomas Hunziker wrote:

Merged by review


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13659 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABw66aUhqnLbgla41od3OfftDY0Ec91cks5rUMBfgaJpZM4LpUob.

Further it looks like the first group is used by com_fields...
image[/image]

avatar Bakual
Bakual - comment - 20 Jan 2017

Those strings either have to come from the plugins, or not be translated at all. It doesn't make sense to have them in com_fields as it would only work for core fields. So the removal is correct.

@laoneo Do you have an idea how we can use the plugin language strings to translate the field type in the fields list?

avatar mbabker
mbabker - comment - 21 Jan 2017

Look at Smart Search and how it deals with getting translations from plugins.

avatar infograf768
infograf768 - comment - 21 Jan 2017

In fact, we should NOT imho translate the $item->type.
This implies that it also should not be translated in the dropdown and should not have any caps.
Example of what I think we should get for color:

PLG_FIELDS_COLOR="Fields - Color"
PLG_FIELDS_COLOR_LABEL="color"
PLG_FIELDS_COLOR_XML_DESCRIPTION="This plugin lets create new fields of type 'color' in the extensions where custom fields are implemented."
avatar infograf768
infograf768 - comment - 21 Jan 2017

I can make a patch for that.

avatar Bakual
Bakual - comment - 21 Jan 2017

Currently it is translated in the dropdown.
I honestly don't care much if we translate it or not, But it must be consistent.
I can see arguments for both. For most of the current types they equate to a HTML element. There a translation may not make much sense, but a type can as well be something completely different, eg a gallery or a player, then a translation would make sense imho.

avatar infograf768
infograf768 - comment - 21 Jan 2017

This is what I propose;
Not translate the field type in the manager

screen shot 2017-01-21 at 11 34 11

Translate it partly in the plugin, i.e. for French:
PLG_FIELDS_TEXTAREA_LABEL="Zone de texte (textarea)"

which would give for example:

screen shot 2017-01-21 at 11 36 38

@Bakual
What do you think?

avatar N6REJ
N6REJ - comment - 21 Jan 2017

core fields actions is exactly what they are used in.

avatar Bakual
Bakual - comment - 21 Jan 2017

@N6REJ The actions aren't affected by this PR. They have to stay in as you said ?

avatar Bakual
Bakual - comment - 21 Jan 2017

@laoneo That's for the dropdown. In the manager list, the type tries to translate it in another way: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_fields/views/fields/tmpl/default.php#L155-L159, taking keys from "COM_FIELDS_TYPE_" which obviously will not work for the plugins. It falls back to the untranslated type of the field. So currently that code is useless ?

avatar laoneo
laoneo - comment - 21 Jan 2017

But it needs to use the same patter as the type field or?

avatar Bakual
Bakual - comment - 21 Jan 2017

I think it would make sense

avatar infograf768
infograf768 - comment - 22 Jan 2017

@laoneo @Bakual
I will make a PR later today where both Translation and field type will display in the dropdown.
The field type will be a variable in the plugin lang strings.
Example:

PLG_FIELDS_TEXTAREA_LABEL="Zone de texte (%s)" ///for French and PLG_FIELDS_TEXTAREA_LABEL="Textarea (%s)" ///for en-GB

Code in fieldplugin.php will be something like:

			if (JFactory::getLanguage()->hasKey('PLG_FIELDS_' . $key . '_LABEL'))
			{
				$data['label'] = JText::sprintf('PLG_FIELDS_' . $key . '_LABEL', strtolower($key));
			
				// Fix wrongly set parentheses in RTL languages
				if (JFactory::getLanguage()->isRTL())
				{
					$data['label'] = $data['label'] . '&#x200E;';
				}
			}
			else
			{
				$data['label'] = $key;
			}

Will use only the pure field type in the Fields list column for now.
If judged necessary, we may add later a new method in the helper to load all fields plugin lang files to display also Translation (field type) in the column.

avatar laoneo
laoneo - comment - 22 Jan 2017

Honestly I would not add the field type as it is a technical thing where the end user doesn't care about. If extension developers are creating custom fields with some more complicated names then the label can look more confusing than it will help. Perhaps we can add the plugin name for better recognition.

avatar infograf768
infograf768 - comment - 22 Jan 2017

Custom fields are technical things and an end user who does not understand what is a field type would anyway be lost.
Anyhow, if this proposal is not accepted, I will not lose time making a PR.

avatar laoneo
laoneo - comment - 22 Jan 2017

What do you think about the plugin name?

avatar infograf768
infograf768 - comment - 22 Jan 2017

Why use the plugin name? It adds "Fields - " and it is useless.
The Label is perfectly fine, once the code I propose is used. Showing the "real type" next to the Translated Label is a good solution for me.

avatar Bakual
Bakual - comment - 22 Jan 2017

What do you think about the plugin name?

Nah, because the plugin in theory could have more than one field type.

avatar infograf768
infograf768 - comment - 23 Jan 2017

Made a PR (which also corrected an error for the user field as it is not multiple and has no plugin settings) #13710

Add a Comment

Login with GitHub to post a comment