The keys are not meant to be translated, as far as I could tell. They represent a unique entry for a single object. If the keys weren’t unique, then you wouldn’t need to define them on creation. You’d just need an id.
They are used for pretty URLs, however, and I do realize that that could represent an issue. But, if the key in the path is unique, and the name of the object is the same as the key, I think you could get away with creating your own route which takes the name as the parameter (since they’re not Documents and don’t have a fixed translation which also represents a URL), if you get my drift.
I figured out how this could be done. The magic would happen in the AdminBundle DataObjectController.
On line 226, we see that we’re stripping htmlspecialchars. Instead of this, we could use the builtin $this->trans($key) method exposed in the controller to fetch a translation from the admin translations.
If each and every path of the DataObject tree gets translated, I think it could be potentially harmful when there is a bunch of untranslatable items, it would clutter the admin translations with junk.
What do you think of the following options:
Option 1: enable the translation based on the Object Class, for instance I would enable it on DataObject\Folder, PrintingTechnique and PrintingOption but not on PrintingColor because there are 1893 Pantones in this folder that do not need to be translated.
Option 2: add a boolean property in the Class General Settings panel (we could name translatable keys)