I would like to be able to create internationalized and localized webforms. There's no 'translations' tab for webform nodes and looks like the form text elements (field labels etc.) are not fed thru t() when they are displayed. I have not looked into code yet, but I assume this, because those texts do not appear to administer --> localization --> manage strings.

By far the only solution i have figured out is to create one webform per language and alias them as 'langcode/formname' and create menu entry to 'formname'. The (deep) downside is that submissions go to separate pools. Are translated webform nodes supposed to be done like this? If, I dare to suggest either supporting webform node translations or more aggressive usage of t(). If not, then how?

I have

  • drupal 4.7.3
  • i18n module (4.7.0, 06/08/2006 - 01:15, 38.92 KB)
  • webform module (4.7.0, 26/09/2006 - 04:16, 58.69 KB)

Comments

terotil’s picture

Forgot to mention that my 'solution' includes manually inserting translation relationship to database. In the example below nodes 9 and 12 assigned to new translation group (max(trid)+1 gives a yet-unused trid), 9 as english translation and 12 as finnish. (Schema for drupal_tuotanto_i18n_node is given as a reference.)

mysql> describe drupal_tuotanto_i18n_node;
+----------+------------------+------+-----+---------+-------+
| Field    | Type             | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+-------+
| nid      | int(11) unsigned | NO   | PRI | NULL    |       | 
| trid     | int(10) unsigned | NO   |     | 0       |       | 
| language | varchar(12)      | NO   |     | NULL    |       | 
| status   | smallint(6)      | NO   |     | 0       |       | 
+----------+------------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

mysql>select max(trid)+1 from drupal_tuotanto_i18n_node;
+-------------+
| max(trid)+1 |
+-------------+
|           6 | 
+-------------+
1 row in set (0.00 sec)

mysql>insert into drupal_tuotanto_i18n_node values
( 9, 6, 'en', 0),
(12, 6, 'fi', 0);
terotil’s picture

...and as I later found out (the hard way) also {i18n_node_trid} entry in {sequences} table must be updated accordingly. In the previous example correct queries to do next trid retrieval and sequence entry update are the following.

mysql> select id+1 from drupal_tuotanto_sequences where name = 'drupal_tuotanto_i18n_node_trid';
+------+
| id+1 |
+------+
|    6 | 
+------+
1 row in set (0.00 sec)

mysql> update drupal_tuotanto_sequences set id=6 where name='drupal_tuotanto_i18n_node_trid';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql>
klance’s picture

I've been using webforms with the i18n module for nearly a year. If you haven't done so, go into administer->settings->content types and enable multilingual support for the webform content type. This will make the "translation" tab appear in the "stock" version of webform.

quicksketch’s picture

Status: Active » Closed (fixed)