Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » [userforms] Translation of messages

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1191 Views
  • __fabrice
    Avatar
    Community Member
    32 Posts

    [userforms] Translation of messages Link to this post

    Hi,

    I search, for a moment, how to translate all the messages who appears, for example, when fields are not valid.
    For now, the default language is english, but i want to change it.

    I see there was a "lang" directory in the module. How can I use it ?

    Thanx,

    Fabrice

  • baba-papa
    Avatar
    Community Member
    279 Posts

    Re: [userforms] Translation of messages Link to this post

    Hello fabrice,

    in your config.php you have to activate the multilingial (i18n) support:

    i18n::enable();


    Then you have to set your system language:

    i18n::set_locale('de_DE');

    The multilingual support is right buggy in that module. So you have to customise some code. The validation messages e.g. "is a required field" are javascript. Find that file with an IDE codesearch and replace that text.

    Good luck ;)

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: [userforms] Translation of messages Link to this post

    Hi,

    I have already done this :

    i18n::enable();
    //i18n::set_default_lang('fr');
    i18n::set_locale('fr_FR');


    But, the administration backoffice send me an error :
    [User Error] Couldn't run query: SELECT Lang FROM SiteTree_lang GROUP BY Lang Table 'ss_bizup.sitetree_lang' doesn't exist

    Ok, for the rest, i modify the js files as you say.

    So, I try to change to use the js file /sapphire/javascript/lang/fr_FR.js, but with this :

    i18n::enable();
    i18n::set_default_lang('fr');
    i18n::set_locale('fr_FR');


    ... nothing change

    Thanx
    Fabrice

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: [userforms] Translation of messages Link to this post

    Hi,

    No answers ?

  • abdu1234
    Avatar
    Community Member
    1 Post

    Re: [userforms] Translation of messages Link to this post

    Hi __fabrice,
    i had that problem,
    I run: sake /db/build/
    and the admin section is restored but the site still displays the problem.

    if i remove: i18n::set_default_lang('fr');

    the site is displayed but no transplation

    any ideas?

  • __fabrice
    Avatar
    Community Member
    32 Posts

    Re: [userforms] Translation of messages Link to this post

    Hi,

    In my opinion, you must comment all the lines concerning the translation.

    Fabrice

    1191 Views
Page: 1
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.