CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Webform Localization
Pages: [1]

Author Topic: Webform Localization  (Read 1050 times)

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Webform Localization
November 24, 2014, 09:23:53 am
Has anyone here used the Webform Localization module with CiviCRM? I've got the "questions" showing translated, but although I was shown the strings to translate for the multiple-choice "answers" they are still showing in English.
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Localization
November 24, 2014, 10:37:58 am
Is this a CiviCRM field with options coming from the civi db?
Is "live options" enabled?
Try asking your question on the new CiviCRM help site.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Webform Localization
November 24, 2014, 10:51:55 am
Hey Dave - we just hit the same issue - we can get the Form translating questions - we even had it translating strings from webform component options - but not with civi ones - for now we just accepted it was quicker to set them to static and edit them - even though there were 50 fields with same 5 options.
We will come back to look at it when they roll out another language version of the form. And I will point chris here to add his more technical explanation of what tried/failed.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Webform Localization
November 24, 2014, 12:08:29 pm
I've just confirmed that I can localize a Webform CiviCRM option via ?language=da on a site with Webform CiviCRM 7.x-4.8+9-dev, Webform Localization 7.x-4.x-dev, and Fuzion CiviCRM 4.4.9.

Webform Localization won't kick in unless you activate multiple languages, so make sure you are seeing other elements on the site get language translation (configure @ admin/config/regional/language) before expecting CiviCRM to translate.

Once that's firing, you need to edit each Webform element for Webform Localization to detect it and add it to the translations interface (admin/config/regional/translate/translate) for you to translate. At this point you should find that your CiviCRM options are translated.

We found that although it worked, it was easier for the client to re-input the questions in the language of the specific node (since only one node was translated for this project).

From memory (call me out if wrong here), Webform Localization stores the localization keyed by the form / element. For us this meant that translating the multi-choice answers (red, green, blue) across 24 questions would be a longer process than updating the options themselves (since both CiviCRM and Webform allow you to recycle option lists). So we backed away from it in this instance. Obviously both approaches could be shortcut via SQL, but that's not what the client wanted.

Look forward to hearing how you get along!
@xurizaemon ● www.fuzion.co.nz

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Webform Localization
November 25, 2014, 02:33:18 am
@Coleman: Yes, I'm talking about multiple CiviCRM custom fields with option groups (in some cases sharing option groups) for radio buttons and checkboxes. They are using live options. Gender, which is using static options, has both the question and the answers translated but strangely enough "- Select -" is in English.

@Chris: English and Welsh are present and enabled. Each webform where translation is required has "Expose webform component strings suitable for translation." and "Keep a single webform across a translation set." checked under "localization by string translation" in webform settings. I have already been shown the strings for the options in the string translation interface, and have entered the translations just like I did for the questions. You say "the language of the specific node"- is this necessary? We'd rather not have separate nodes for separate languages if we can avoid it due to the amount of custom code in our system.
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Webform Localization
November 25, 2014, 02:40:59 am
When I edit the webform node and go to the Webform tab, I see a number of "Notice: Array to string conversion in wf_crm_admin_component::preprocessComponentsForm() (line 555 of /var/www/html/prod/drupal-7.32/sites/all/modules/webform_civicrm/includes/wf_crm_admin_component.inc)."
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Webform Localization
November 25, 2014, 04:11:04 am
Quote from: DaveFF on November 25, 2014, 02:33:18 am
You say "the language of the specific node"- is this necessary? We'd rather not have separate nodes for separate languages if we can avoid it due to the amount of custom code in our system.

This shouldn't be necessary, it's just how it was on our site.
@xurizaemon ● www.fuzion.co.nz

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Webform Localization
November 25, 2014, 05:08:46 am
So I did an experiment, and added a new custom field to an existing group sharing an existing option group. In the webform I enabled it and set it to static, so there is a live-options version of the question immediately followed by a static-options version. Then I refreshed strings and entered the translations (as I had already done for the live version). The live version still displays in English but the static version now displays the Welsh translations.
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Localization
November 25, 2014, 05:24:10 am
@DaveFF what conclusion are you drawing from that experiment? That is the result I would have expected.
AFAIK the only way to have "live options" come out in a different language would be if CiviCRM were set to be multilingual and to follow the cms language.
Try asking your question on the new CiviCRM help site.

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Webform Localization
November 25, 2014, 05:50:24 am
Quote from: Coleman Watts on November 25, 2014, 05:24:10 am
That is the result I would have expected.
Didn't know that. Thanks for your help. I suppose we'll have to set the webform options to static then.

We don't need the whole system multilingual, just the webforms at the moment. And it won't let me set multilingual anyway because it's incompatible with logging...
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform Localization
November 25, 2014, 06:14:08 am
The reason that's the expected result is because "live options" always fetches the options afresh from the CiviCRM api. The api will always return the options in the default language.
Try asking your question on the new CiviCRM help site.

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: Webform Localization
November 25, 2014, 09:47:26 am
Thanks for responding. What would be involved to make it translate the live options?
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Webform Localization
December 02, 2014, 08:04:06 pm
My expectation was that Webform CiviCRM would pass its text strings through t() when displayed, so that it would fetch 'Mushrooms' from CiviCRM API, run t('Mushrooms'), and the translation layer would transform this to 'Madarch' (or what have you).

Webform Localization seems to take quite a different route though?
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Webform Localization

This forum was archived on 2017-11-26.