Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

User Defined Forms with multi-lingual web sites - not working


Go to End


12 Posts   5032 Views

Avatar
ayyurek

Community Member, 41 Posts

5 October 2009 at 11:13am

Hi,

I am building a multilingual web site with SS 2.3.3 with two languages. Turkish and English. Turkish is the default language. User-defined-forms doesn't work with multilingual sites?

When I try to add fields to the translated pages (second language), I get error ''I can't handle sub-URLs of a CMSMain object''

And also, I have a subsite (using subsites module) which is only in english (single language).. When I create a form and try to add fields, again get I can't handle sub-URLs of a CMSMain object errror. Or 'Not found' error.

Does anybody have the same situation?

Avatar
Willr

Forum Moderator, 5523 Posts

5 October 2009 at 4:11pm

UserForms is not compatible with Translatable / Multilingual sites. See http://open.silverstripe.com/ticket/4040 for the issue in the bug tracker

Avatar
Kalileo

Community Member, 127 Posts

5 October 2009 at 5:44pm

ayyurek, there is a workaround posted here somewhere, by me and by Juanito, some months ago. Using that you can get it to work.

Avatar
ayyurek

Community Member, 41 Posts

7 October 2009 at 12:48pm

Will, thank you very much for answer. You are fast as always :-)

Kalileo, thank you! I found the post where you and Juanito were. It was about changing the values directly in the database. Actually, I use latest trunk of Userforms, and the problem is it's not creating any fields at all (not just incorrectly assigned id's)

I found a funny but simple way.

I created my form in the default language, added the fields, added the email recepients etc. Then I created a translation in my second language. Saved the page. Then in my _config.php, I changed the default locale. Flushed the site. I added fields on the translated form, made other changes. Saved it. Then switched back to my original locale =)

I know it's funny, but it worked..

So for people who will have the same problem,
Add your form as usual, then go to your _config_php file which is located under mysite folder. Change the lines below depending on your structure. In my example, I have Turkish (tr_TR) as second language.

i18n::set_default_lang('en_US');
i18n::set_locale('en_US'); 
Translatable::set_default_locale('en_US');

to
i18n::set_default_lang('tr_TR');
i18n::set_locale('tr_TR'); 
Translatable::set_default_locale('tr_TR');

Edit your form, which was not possible to edit before. And then switch back to old language settings in the _config.php file.
I don't think that i18n settings have any effect, just changing default locale is enough, but anyway I wrote them above, because I was lazy to try it one by one.

Regards

Avatar
Kalileo

Community Member, 127 Posts

7 October 2009 at 3:09pm

Avatar
ayyurek

Community Member, 41 Posts

7 October 2009 at 4:58pm

Hi Kalileo,

No, I didn't see. I just saw the page where Juanitou and kateh were discussing. Thank you very much for workaround. But changing the default_locale solves the problem very fast. It takes 10 seconds. I checked the database, everything is correctly created and assigned.

But I don't understand actually. Is this a very big bug to solve?

Avatar
Patrick

Community Member, 11 Posts

28 May 2010 at 1:28pm

I know this is a relatively old thread, but I ran into it looking for solutions, so I thought I would post my findings.

I have my multilingual 2.3.6 site set up to be handled by different domains (englishdomain.com, spanishdomain.com and portuguesedomain.com) via .htaccess redirects. I tried the suggestion of changing the mysite _config.php settings, but it didn't work for me.

However, logging into the admin area from the specific domains seemed to do the trick. For example, if I log into englishdomain.com/admin and try to create a Spanish form, I get errors. However, if I log into spanishdomain.com/admin, I can create the form with no errors.

Now, it doesn't duplicate the form fields in the target language, but at least I'm able to add the fields without getting any errors.

Hope this helps someone.

Avatar
Robert1123

Community Member, 6 Posts

4 June 2010 at 6:38am

I have this problem and have been investigating this over the last few days. I have reviewed the various threads, but I am unable to see the quick fix solution. Could anyone give me a good guide as to how I go about fixing this issue.

I am using SS 2.3.2 and using a single domain with multiple language variations (English, French and Spanish)

Thanks

Go to Top