I'm having a problem with a multilingual site and using the modal form module.

My site's default language is Japanese, but I have enabled Drupal's multilingual systems and some forms are in Korean and English.

When I view the normal webform page, the interface text (error messages, submit button, etc.) is localized in Japanese, English, or Korean (see attachment node.jpg).

But if I use the modal to view the webform, the site's default language is used (see attachment modal-form.jpg).

Using Firebug in the modal, I can see the i18n-en class on the body tag, so it seems like it should recognize to display the text in English.

Thank you

CommentFileSizeAuthor
modal-form.JPG20.63 KBJill L
node.JPG14.61 KBJill L
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bavarian’s picture

Having the same problem here.

In normal web form view, the node is displayed in the desired language, when switching languages.
But: when using the modal I always end up with a display of the site's default language.

Feels important for me to get this resolved ...

nbchip’s picture

Check if your links to modal form are prefixed with language code.

<a class="ctools-use-modal" href="en/modal_forms/nojs/login">Modal Login</a>

Of course u should always use l function.

make77’s picture

Hello, I still had some issues with translated modal forms, even if I have the language prefix in the href. Here's my workaround to make the register form work in the modal, I used $language_url that gave me the proper language:

/**
 * Implements hook_init().
 */
function my_module_init() {
  global $language;
  global $language_url;
  if (current_path() == 'modal_forms/ajax/register') {
    $language = $language_url;
  }
}