Closed sauerbraten closed 1 year ago
Yes that makes a lot of sense. Since you can use multiple languages in the CP it's not pretty that field names aren't localised. Same goes for collection titles, taxonomies and asset containers.
This is how Kirby does it in .yaml files.
https://getkirby.com/docs/guide/blueprints/translations#labels-placeholders-and-help-text
Also looking forward to localized field values and instructions. This will be really helpful for a lot of usecases.
This would be particularly useful for multilingual forms.
And multilingual starter kits! Still a lot of manual labour now to translate one and no way to include the translations.
In the same order of ideas, it would also be useful to have localizable default values.
Ran into this one today when I needed to localize select options in a formset. As a workaround, I created 2 localized array fields (company_types
and regions
) in Globals to set my options for each locale:
<select name="{{ handle }}{{ multiple ?= "[]" }}" {{ multiple ?= "multiple" }} class="form-select block w-full pl-4 pr-10 py-3" :class="{ 'border-red': errors.{{ handle }} }">
{{ unless multiple }}
<option value>{{ placeholder }}</option>
{{ /unless }}
{{ if options }}
{{ foreach:options as="value|label" }}
<option value="{{ value }}" {{ if old|in_array:value or old === value }}selected{{ /if }}>{{ label }}</option>
{{ /foreach:options }}
{{ elseif handle == 'company_type' }}
{{ foreach:company_types as="value|label" }}
<option value="{{ value }}" {{ if old|in_array:value or old === value }}selected{{ /if }}>{{ label }}</option>
{{ /foreach:company_types }}
{{ elseif handle == 'region' }}
{{ foreach:regions as="value|label" }}
<option value="{{ value }}" {{ if old|in_array:value or old === value }}selected{{ /if }}>{{ label }}</option>
{{ /foreach:regions }}
{{ /if }}
</select>
It'd be useful to be able to translate the title and have the slug update as well. Playing with my first multi site today.
What's the current state of this issue? Any plans to tackle that in the near future?
@motion-work It's on our roadmap. No ETA though.
amazing! thank you.
Hey guys, is there a workaround to translate labels/instructions in the meantime?
Nope
Tried to come up with a list for stuff that should be translatable. Can anyone think of any additions here?
It would be useful if our blueprints could have localized display names for their fields.