Closed (fixed)
Project:
Webform Validation
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2013 at 15:40 UTC
Updated:
31 Mar 2014 at 16:26 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quasi commentedAny thoughts on this?
Thank you!
Comment #2
liam morlandError messages defined in the module are run through the t() function for translation. If you are using the module's hooks to create validators in your own module, you would have to call t() yourself.
I haven't done much with translation. Is something else needed to make it work with the i18nstrings module?
Comment #3
quasi commentedHey Liam,
thank you for your answer!
If I insert an error message through the interface it doesn't come up as a translatable string,
however if I insert it in a hook it does.
Thanks!
Comment #4
liam morlandIt sounds like Webform Validation needs a patch that would pass the error messages through t().
Comment #5
Khetam commentedHere's the patch......
Please check it.
Thanks,
Kito.
Comment #6
Khetam commentedComment #7
liam morlandThanks very much.
Can someone else who uses i18nstrings module please check that this patch works? If it does, please set the issue status to RTBC. Thanks.
Comment #8
paypaul commentedThis patch didn't fix the translation of custom error messages for me. I did figure out a solution though. It seems like all of the translation stuff for the module is targeted at Drupal 6. The name of the Internationalization module under Drupal 7 is different. Also the API for the module has changed quite a bit. I added hook_i18n_string_info() to define a textgroup for Webform Validation and changed some i18n calls in a few places and now string translation is working great for me under Drupal 7. I will submit a patch shortly.
Comment #9
paypaul commentedHere is the patch. Thanks.
Comment #10
liam morlandThanks very much. Is there anyone else who can test this?
Comment #11
liam morlandThanks very much.
http://drupalcode.org/project/webform_validation.git/commitdiff/4fcd8da
Comment #13
Khetam commentedI changed small thing and the patch worked fine.
Comment #14
liam morland@Khetam: Please explain what your patch is for. "Patch (to be ported)" is used to mark issues that have a patch which needs to be ported to another version of the module. Marking items "Patch (to be ported)" should be accompanied by changing the version number to the version which needs the patch. Once the patch is ready, the status should be "Needs review".
Comment #15
liam morlandComment #16
Khetam commentedWhen i tried the old patch it was not showing any webform error messages or translating them so i remove this line of code
return i18n_string('webform_validation:error_message:' . $rule['ruleid'] . ':message', $rule['error_message']);and added this line
t($rule['error_message']), The messages start appearing on the translated string tab.Thanks.
Comment #17
Khetam commentedComment #18
liam morlandYour patch does not apply to the latest development version of Webform Validation; it needs work.
What is
module_exists('i18n')for? t() doesn't require i18n module to be installed.It looks like what you are trying to do is remove the support for the i18n module. That may be a worthwhile goal; I don't know enough about translation to know that. If that is the case, that needs to be done in a separate issue. Setting status back to what it was.