Hi i wonder how to translate the (required) text added to required fields.

Thx for a great module!

Comments

guschilds’s picture

Hey Strutsagget,

The required text can be changed sitewide at admin/config/content/webform-hints.

To have different required text for different languages, I believe multilingual variables are needed to properly translate the setting.

It appears this would involve the Internationalization module. The documentation for Using the i18n API from other modules mentions using variable hooks to expose module settings for translation.

I don't have much experience with hook_variable_info(), but let us know if you're able to get that working or if you need us to give it a shot.

Gus

guschilds’s picture

Title: Translate (requierd) text » Translate (required) text
Status: Active » Needs review
StatusFileSize
new1.11 KB

Strutsagget,

I was able to pull it off.

You'll need to:

  1. Ensure you're using the latest release of Webform Hints.
  2. Enable the i18n and i18n_variable module.
  3. Have multiple languages at admin/config/regional/language.
  4. Enable URL detection on admin/config/regional/language/configure (optional).
  5. Navigate to admin/config/regional/i18n/variable
  6. Enable the "Required indicator" variable in the "Webform hints" group.
  7. Navigate to the Webform hints settings at admin/config/content/webform-hints.
  8. Click the other language near the top under "There are multilingual variables in this form".
  9. Translate the required variable for that language and save the form.
  10. Navigate to the same webform under multiple languages to confirm it has worked.

Hope that helps!

Gus

Strutsagget’s picture

Ok thx ill give it a try! Thx for the feedback and a great module!

guschilds’s picture

Any luck with this, Strutsagget?

Strutsagget’s picture

Hi, sorry for slow feedback. //started using a symbol * and forgot

Works like a charm. Needs a clear cache before step 6.

Thnx alot!

  • guschilds committed 2a4a982 on 7.x-1.x
    Issue #2287509 by Strutsagget, guschilds: Added multilingual support to...
guschilds’s picture

Status: Needs review » Fixed

Great. Thanks for giving it a shot!

This has been added to the module and is now available in the latest dev release. Once we roll out 7.x-1.5, it'll be there too.

I'm going to edit the instructions in #2 for anyone that ends up here in the future.

Thanks again,
Gus

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.