Localization for enum possible?

System Information
  • Strapi Version: 4.6.0
  • Operating System: Ubuntu
  • Database: better-sqlite3 7.6.2
  • Node Version: v16.18.1
  • NPM Version: 8.19.2
  • Yarn Version: n/a

We are using a enumeration field at a recipe collection type to ingredient measurements unit. So to ask the editor if it is in cup, gr, ml, kg, l, spoon, tablespoon, teaspoon. But it seems the enumeration field does’n t have the Localization option. For the output we need to have translation values given in the CMS. What would be our options?
Thanks for helping.

2 Likes

Need an anwer too !

Open your model file and modify the enumeration field to include multi-language support. For example:

{
“kind”: “enumeration”,
“name”: “status”,
“options”: [
{ “id”: “active”, “label”: { “en”: “Active”, “fr”: “Actif”, “es”: “Activo” } },
{ “id”: “inactive”, “label”: { “en”: “Inactive”, “fr”: “Inactif”, “es”: “Inactivo” } },
{ “id”: “pending”, “label”: { “en”: “Pending”, “fr”: “En attente”, “es”: “Pendiente” } }
],
“label”: “Status”
}

Hey @Zaib, what version of Strapi do you use?

Your proposed solution unfortunately doesn’t seem to work with Strapi version 4.11.5