Jump to:

10987 Posts in 2724 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » User Defined Forms with multi-lingual web sites - not working

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2916 Views
  • ayyurek
    Avatar
    Community Member
    41 Posts

    User Defined Forms with multi-lingual web sites - not working Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

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

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

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

  • ayyurek
    Avatar
    Community Member
    41 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

    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

  • Kalileo
    Avatar
    Community Member
    127 Posts
  • ayyurek
    Avatar
    Community Member
    41 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

    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?

  • Patrick
    Avatar
    Community Member
    11 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

    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.

  • Robert1123
    Avatar
    Community Member
    6 Posts

    Re: User Defined Forms with multi-lingual web sites - not working Link to this post

    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

    2916 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.