grav-plugin-flex-objects
grav-plugin-flex-objects copied to clipboard
FInd a way to make flex object names translatable
In order to provide good translations for the admin interface of grav we have to think of a way to make the name of a flex object (e.g. contacts oder pages) translatable as singular and plural. see admin\templates\flex-objects\types\default\modals\remove.html.twig
This approach can even reach to translatable column/field names.
What comes to the name, I think the best approach could be to either to pass the translation keys in the blueprint or use some generated strings based on the type.
@mahagr in https://github.com/trilbymedia/grav-plugin-flex-objects/issues/123#issuecomment-822259162
I would like to provide a suggestion for this in the next days.
Lost track of this but after working with translations in blueprints, i would like to propose the addion of two fields, name_plural and name_singular, to the blueprint definition:
title: Events
description: Manage your list of events
type: flex-objects
name_plural: Events
name_singular: Event
or with use of translations:
title: PLUGIN_EVENTLIST.EVENTS
description: PLUGIN_EVENTLIST.EVENTLIST
type: flex-objects
name_plural: PLUGIN_EVENTLIST.EVENTS
name_singular: PLUGIN_EVENTLIST.EVENT