Hi! How can I translate the options of my select field type in my blueprint?
Thanks.
You can do it like this:
my_field:
label: My Selection
type: select
options:
a:
en: This is the A Option
de: Das ist die A Option
b:
en: This is the B option
de: Das ist die B option
Note that this will not add a translation to the file, you can, however, translate the options in your language files.
@texnixe I have “en” and “ar” added in my config.php.
I have this in my blueprint
city:
label: City
type: select
default: Riyadh
options:
riyadh:
en: Riyadh
ar: الرياض
but the Arabic translation won’t show in my panel even with Arabic language selected.
Note that this will not add a translation to the file, you can, however, translate the options in your language files.
Sorry but I don’t quite understand what you meant.
The translation is only shown if the user selects that language in their user profiles, not if you change the language in the topbar.
What I mean is, that in case of the above example, if the user selects “riyadh”, the key “riyadh” will get saved to file, not the label value “Riyadh”.