21490 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 905 Views |
-
(Solved) translation in .php

19 September 2010 at 5:37am Last edited: 22 September 2010 9:08am
How to translate the array-s in php and how to setup them in lang file
-
Re: (Solved) translation in .php

19 September 2010 at 12:09pm
Have a read of the documentation on http://doc.silverstripe.org/i18n. That should have all you need to know!
-
Re: (Solved) translation in .php

19 September 2010 at 7:18pm
"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]}'"); -
Re: (Solved) translation in .php

21 September 2010 at 1:48am
is it even possible to make translateable the enum and then the searchable field title
-
Re: (Solved) translation in .php

21 September 2010 at 12:25pm
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.
-
Re: (Solved) translation in .php

22 September 2010 at 9:08am
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 securityIDand for enums added both languages in one enum they where only needed for filtered search.
| 905 Views | ||
|
Page:
1
|
Go to Top |


