I needed to translate the prefix and suffix values I added using the form markup module.

In my use case I was adding a label and some descriptive text to the form and needed to have it translated.

Attached is a really simple patch that just wraps the output in a translation "t" tag.

Cheers!

CommentFileSizeAuthor
form_markup_translation.patch706 bytesArchiteck

Comments

Architeck’s picture

Status: Needs review » Needs work

I realize, after some testing, that this is not the best approach.

For a few reasons,

1) the translation interface doesn't like html markup, and we don't really want to do this (http://drupal.org/node/372965)

2) It works.. but in some cases you may get an empty 'Array' printed out on the screen. I had to remove the t() function from the suffix field to get the result I was hoping for.

An overall better approach would be to add some filtering options to the #prefix and #suffix textareas that would allow the user to choose html or php code input format, then they can run their own code through the t() if it needs to be translated.

Architeck’s picture

Status: Needs work » Closed (works as designed)