Add translation hook for metadata content#2987
Add translation hook for metadata content#2987nbusseneau wants to merge 2 commits intogetgrav:developfrom
Conversation
Users can override site.yaml metadata keys by providing a corresponding GRAV.METADATA.key via languages.yaml.
|
While skimming the doc, I discovered that we can actually override the Discussion: the translation hook trick would only be useful if one wants to localize the default global I have given it some more thought and I believe a good solution would be to mimic what's currently possible with templates: https://learn.getgrav.org/16/content/multi-language#language-based-twig-templates Subfolders for overriding config values, e.g. What do you think? |
Global metadata coming from translations will only be used if currently processed metadata was not overriden at the page level.
Problem: I wanted to localize the
descriptionmetadata, but couldn't find a way to localizesite.yaml.I settled on using
languages.yamlas a way to localizesite.yamlmetadata keys frommetadata.html.twig, when they exist in both.Users can override
site.yamlmetadata keys by providing a correspondingGRAV.METADATA.keyvialanguages.yaml.This is a working PR, but I don't believe this solution is elegant, even if it works fine. Input is welcome. Ideas?