• Hi,

    I have a participants database with 4 fields and a button. I have a multilingual site with WPML.
    I need to translate the name of those 4 fields and the button into a second language for the form and the heading row of the table displaying entries.

    I understand there is no official WPML support, so I’m reaching out to see if there is a quick and dirty way of doing this. I even don’t mind putting php code in my child theme function with hard-coded values based on the language field. I’m not a developper, so I would need to see sample code to adapt it to my site.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Marc

    (@arbolife)

    Plugin Author xnau webdesign

    (@xnau)

    That’s an interesting approach, but you need to be careful with it, it can cause your PHP to use large amounts of memory if you have any pages with lots of weighty content.

    As has been answered elsewhere, Participants Database passes all it’s display strings through the gettext filter when PDB_MULTiLINGuAL is set to true. I don’t know if this helps for use with WPML, I don’t have any experience with that plugin, but this will be far less memory-intensive than buffering the whole output.

    This may help: Localizing Participants Database

    Thread Starter Marc

    (@arbolife)

    Hi,

    I know it’s terrible. I had to do it because I found no other way. I have a mile long functions.php with filters to translate the plugin’s output. Really ugly, but I was under a deadline. The site is a “landing page” in 2 languages with a form to sign-up, so performance doesn’t seem to be an issue.

    I did try PDB_MULTiLINGUAL and used any gettext filters I could find, I never got to the field headers. I spent half a day trying to make it work and failed miserably.

    With this ugly method, I managed to translate the whole plugin’s output, except for the email sent to participants. Any idea how to do that?

    I’d be more than happy to experiment a cleaner way and let you know so you can document how to do it. I’m not a coder but am literate enough to make things work from examples, so I’d need some pointers on how to get started. I thinks this is really missing, you claim your plugin is multilingual but nobody I found managed to make it work with whether it be with WPML, Polylang or even gettext filters.

    Thanks,
    Marc

    • This reply was modified 7 years, 4 months ago by Marc.
    • This reply was modified 7 years, 4 months ago by Marc.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Field and button translation with WPML’ is closed to new replies.