I’m currently translating a site’s panel (the site is NOT multilingual, but the panel will be available in two languages). Instead of writing the language specific labels into the blueprints, I use placeholders and insert the translations into a plugin like so:
So far everything was translatable as expected, but I got to a page type that uses radio and select fields. I can not figure out how to set the placeholder values in the options array in these fields as they are never translated but the placeholders are shown.
Thank you for the reply. Could you please clarify why this is not supported and is it planned to be supported?
Using placeholders instead of burning in the values of different languages helps the separation of concerns, it keeps the blueprints shorter and easier to understand, also translators don’t need to read / understand YML files. @bastianallgeier do you agree?
Using placeholders for labels is not my idea, the Kirby Core is build this way as well, the translations are separated. For example take the Image Block:
All translatable strings are using placeholders, for example the first line:
In my example above, I just try to do the same. Also, using plugins for translations instead of inserting the values directly into the blueprints is something the documentation suggests: Translations | Kirby CMS
I can only tell you that it is currently not supported, but not why. Maybe it wasn’t requested yet. You can create a feature request at https://kirby.nolt.io/
I also noticed in the meantime, that although neither select nor radio support placeholders under their options property, toggle actually does support it under its text property. This is another reinforcement for me, that I noticed a missing edge case while doing a full admin panel translation with placeholders.
If it’s possible, it would be great to hear a second opinion on this case.@texnixe could you please involve someone from the team?
I think this is because language variables (I’d prefer this term because placeholders can be misleading in the context of fields) for these use cases were introduced later and therefore are not implemented everywhere. So you have done the right thing to create the feature request.