Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Each field has a “name” and a “title” the name is a unique identifier you can’t change, but it is not displayed, only used internally. The title can be anything you want…that is where your translated titles should go.

    If you want the “name” to be in another language, you can do that, you just delete the English ones and create new ones.

    Thread Starter luismldias

    (@luismldias)

    Hi Xnau,

    Thanks for the reply.

    I might no have explained myself correctly πŸ™‚

    What i meant was if it’s possible to have titles in different languages for the same form simultaneously.

    Plugin Author xnau webdesign

    (@xnau)

    Yes, but you’l need to know a bit of PHP to pull it off. You’ll have to create a custom template…then grab the WP_LANG global (or whatever global value you are using to select the language of the page) and use that to determine which language to show the title in. Then you add code to the template to replace the title with the selected string.

    In the template, after the line that has $this->the_field(); put something like this:

    <?php $this->field->title = $titles_array[$language][$this->field->name] ?>

    You will want to set up a substitution array to determine the string to use. I’m sorry, I don’t have a solution that doesn’t require some programming!

    Instructions for setting up custom templates is here: http://xnau.com/participants-database/pdb-templates/

    Maybe it is an idea to replace the title using the WP translations like this:

    <?php $this->field->title = __( $this->field->title , 'participants-database'); ?>

    Ofcourse you’ll have to update the language files accordingly…

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Translation’ is closed to new replies.