statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
31 stars 1 forks source link

Allow display names of fields to be localized #50

Closed sauerbraten closed 1 year ago

sauerbraten commented 4 years ago

It would be useful if our blueprints could have localized display names for their fields.

studio1902 commented 4 years 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

Gitsack commented 4 years ago

Also looking forward to localized field values and instructions. This will be really helpful for a lot of usecases.

pryley commented 4 years ago

This would be particularly useful for multilingual forms.

robdekort commented 4 years ago

And multilingual starter kits! Still a lot of manual labour now to translate one and no way to include the translations.

piljac1 commented 4 years ago

In the same order of ideas, it would also be useful to have localizable default values.

mikemartin commented 4 years ago

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>
stephenmeehanuk commented 3 years ago

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.

motion-work commented 1 year ago

What's the current state of this issue? Any plans to tackle that in the near future?

joshuablum commented 1 year ago

@motion-work It's on our roadmap. No ETA though.

motion-work commented 1 year ago

amazing! thank you.

juliencharette commented 1 year ago

Hey guys, is there a workaround to translate labels/instructions in the meantime?

robdekort commented 1 year ago

Nope

robdekort commented 1 year ago

Tried to come up with a list for stuff that should be translatable. Can anyone think of any additions here?