Collection Table Header Labels

Is there a way for me to change the collection table header labels? When I choose ModificationDate, it appears as ModificationDate. I would like the label to display as Modification Date (with a space in between). Please advise.

The version I am using is:

Plone 5.1.0.1 (5110)
CMF 2.2.12
Zope 2.13.26
Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]
PIL 4.3.0 (Pillow)

Any help would be most appreciated. Thank you.

I would be surprised if the collection would support this directly: a collection is a general tool to store a query and, on view, execute the query and present its results. It cannot know appropriate labels for all fields possible in such a presentation. That said, it might be possible that for localization purposes, the standard Collection template uses internationalization features to get translated labels for foreign languages. If this is the case, you could provide an English translation for ModificationDate and it would be shown. If the standard Collection view template does not yet do this, you could register a template of your own that does.

From memory in plone 4 you could. There was a control panel with Index friendly names. But that was lost in plone 5 in the switch to dexerity content types.

You can probably change it with diazo. or with change the view of collection to one from collective.listingviews or eea.facetnavigation which gives more control.

...or write a jQuery one-liner that exchanges the related text through a DOM manipulation.

-aj

Maybe 'this is what needs to be fixed', since I see the same in other languages.

UPDATE: This is a missing translation (entry).

Adding the following to plone.app.locales (/en/LC_MESSAGES/plone.po)

msgid "ModificationDate"
msgstr "Modification Date""

(I assume the same goes for all other languages)

Thank you so much dieter, djay, zopyx and espenmn. You all have been so helpful. I took Espen's advise and redefined ModificationDate to Modification Date. It worked perfectly! Thank you so much!!!

I have another question. Is there a way to incorporate this into my product theme so that I would not have to modify the plone.app.locales product directly?

Assuming that you added a translation, there is this document describing how to add/override translations: Internationalization in Plone 3.3 and 4.0 — Maurits van Rees
It says, it is for Plone 3 and 4, but almost surely, it will work for Plone 5 as well.

via a zip file after installing collective.themesitesetup

1 Like

djay, thank you so much. The instructions were very helpful. This is what I did:

  1. Created a plone.po file at theme.test/src/theme/test/locales/en/LC_MESSAGES/:
  2. Added the following codes to theme.test/src/theme/test/locales/en/LC_MESSAGES/plone.po:
# Gettext Message File for Plone
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI +ZONE\n"
"PO-Revision-Date: 2006-01-29 23:00+0000\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8\n"
"Domain: plone\n"
 
#. Default: "ModificationDate"
#: plone.app.collection.interfaces.ICollection
msgid "ModificationDate"
msgstr "Modification Date"

Restart Plone

Thank you so much everyone for all your help.

Cheers,
Angela

1 Like

This is known issue, see https://github.com/plone/plone.app.contenttypes/issues/211
Who wants to create a fix for this?