Jump to:

23367 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Translating a contact form

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 749 Views
  • patjnr
    Avatar
    Community Member
    101 Posts

    Translating a contact form Link to this post

    Hi

    im really enjoying working with translating in SS.
    i have a site with four languages and i have two types of custome form (1) member registartion form (2) contact form.
    how can i be able to translate the form fields into my four languages.

    here is a part of my form code which i need translated

        new TextField ('Name', 'Name *'),
        new TextField('Vorname','Vorname *'),
        new TextareaField('Adresse','Adresse *'),
        new TextField('PLZ','PLZ'),
        new TextField('Ort','Ort *'),
        new EmailField('Email','E-mail *'),

    tx

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Translating a contact form Link to this post

    You should use the _t() function to define the strings to replace - http://doc.silverstripe.com/doku.php?id=i18n#the_t_function

    _t('A.ENTITY','String that is used in A and B');


    Then run the TextCollector to generate the lang files, This will generate a en_US.php file in your mysite/lang folder which you can copy / paste for other languages - http://doc.silverstripe.com/doku.php?id=i18n#collecting_text

    http://<mysite>/dev/tasks/i18nTextCollectorTask/?module=mysite

    749 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.