How to translate the array-s in php and how to setup them in lang file
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Have a read of the documentation on http://doc.silverstripe.org/i18n. That should have all you need to know!
"Enum('_t('Objekt.KORTER');, _t('Objekt.MAJA');, _t('Objekt.ARIPIND');, _t('Objekt.SUVILA');, _t('Objekt.RIDAELAMU');, _t('Objekt.PAARISMAJA');, _t('Objekt.MAATYKK');')"
gives error:
184 case T_STRING:
185 switch($token[1]) {
186 case 'true': $args[] = true; break;
187 case 'false': $args[] = false; break;
188 default: throw new Exception("Bad T_STRING arg '{$token[1]}'");
is it even possible to make translateable the enum and then the searchable field title
You can't have translations in Enums (as that would make the enum pretty useless). You have to pick a single language from the enum. If you want to translate the labels you can use if ($x = "Foo") .. $label = _t('FOO', 'Foo'); to translate it. Note you also can't use variables inside a _t() as that too would make things not work.
Tnx
made it easier way used:
$form->disableSecurityToken();
for search so i was able to made search template myself with costum code no need for securityID
and for enums added both languages in one enum they where only needed for filtered search.