Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would like to supply a patch for the entity translation module to form alter the Manage Fields form to add a class to the field name based on if the field is translatable or not. This way, i can colour code fields which are translatable to more easily manage which are/aren't set this way. (i did a similar patch to the Fields section of the Views admin page to show which fields are hidden).
Any idea what is the best way to tell the translatable settings for a field? I thought possibly this would be part of the field info that comes with the fields in this form; but sadly it isn't.
Comment | File | Size | Author |
---|---|---|---|
#5 | higlight_translatable_fields-1503034-5948004.patch | 1.23 KB | liquidcms |
Comments
Comment #1
plachSee field_is_translatable().
Comment #3
liquidcms CreditAttribution: liquidcms commentednope, doesn't work.
and looking at code for that function all it is basically doing is returning the $field['translatable'] value which doesn't exist in the form alter. so most likely the step required is how to load a field as the full field info doesn't appear to be available on the Manage Fields form.
Comment #4
liquidcms CreditAttribution: liquidcms commentedfield_info_field()
Comment #5
liquidcms CreditAttribution: liquidcms commentedchanging title, category, status to move this to review attached patch
so i created the patch i elude to above which marks translatable fields on the Manage Fields admin page: http://screencast.com/t/iNuq8SB6a
i liked single color change but a colleague said it wasn't too clear so tacked on TR flag . i wrapped both in spans and added a small css file to set a default for these to match screenshot. people can simply override any of this in css (or string override). i prefer this to what is so far committed for the Views patch i submitted to highlight hidden fields on the views admin page. in that case only thing i was able to get committed was adding a class to the field. which is relatively useless since no one will know there is a method to show hidden fields without some sort of default styling included.
btw.. can't get git to give me a proper patch that adds in the new css file.. so this is from svn
Comment #6
liquidcms CreditAttribution: liquidcms commentedand title change
Comment #8
bforchhammer CreditAttribution: bforchhammer commentedNote that something similar has been committed to the ml_edit_form branch, see #1282018-78: Improve UX of language-aware entity forms.
Comment #9
liquidcms CreditAttribution: liquidcms commentedahh.. yea, i like it there too; but not really the same place i am suggesting to highlight. the Manage Fields form is where developers will be managing fields, including enabling some as translatable.. and provides the only place (other than the field list report) to easily see all the fields listed in a table.
although handy, your approach of seeing it on the node edit form i would guess is more for translating the actual content as opposed to field design.
perhaps i should x-post to that thread? although it still seems more about content translation whereas my patch is more for field management.