I’m building a multilingual site in Grav CMS with 7 languages. One section of the site displays information about statuettes, and each item has shared properties (e.g., size, price, availability) as well as descriptions and names that are specific to each language.
Currently, I keep all data in separate language files, but this creates a lot of duplication. For example, changing the price requires updating all 7 files. I’d like to centralize shared data while keeping descriptions and names in the language files.
Has anyone implemented something similar or found a best practice for this type of setup?
First thing that comes to mind - custom form action Maybe it could save these 3 fields to other languages automatically. For example, when you edit item in language 3 and save it, custom action would take these 3 fields and update in languages 1, 2 and 4-7
There’s a good chance there’s a better way to do it, but that’s what I would probably try with my limited knowledge
Right… I completely forgot you can have a common frontmatter.yaml (even though I use it myself in one of my projects). That would probably be the best way to go
NB: this requires manual YAML file generation and upload. Or someone could make a plugin for that
Thank you for the suggestions. I will conduct tests on the proposed solutions and select the best one for this case. Then, I will follow up on the topic and mark the chosen solution.