Hello there,

When you add a page break in the webform if you entered you're own custom label for (Prev page button label) or for (Prev page button label) the value that you entered will not be translatable! i tried to put a t() in the hook_form_alter() but it didn't work out, after looking into it i noticed that there is no t() in the webform.module file for this custom label:-

please check webform_client_form function in the webform.module file, line 1937

if ($component['type'] == 'pagebreak') {
          $next_page_labels[$component['page_num'] - 1] = !empty($component['extra']['next_page_label']) ? $component['extra']['next_page_label'] : t('Next Page >');
          $prev_page_labels[$component['page_num']] = !empty($component['extra']['prev_page_label']) ? $component['extra']['prev_page_label'] : t('< Previous Page');
        }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

issa.haddadin’s picture

Here is a patch, i just added a t()

issa.haddadin’s picture

Please forget the previous patch! a small problem with branches, here the right one

Thanks.

torotil’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

quicksketch’s picture

I think you're probably right here. We try to avoid too much translation through the t() function (it's a widely discouraged practice to run variables through t()), but we do the same thing for the submit button label, which can't be translated any other way. I'll try to put this in next time I'm reviewing and committing patches. This probably needs to go into all branches.

quicksketch’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed and pushed to all branches. Thanks @issa.haddadin and @torotil!

Status: Fixed » Closed (fixed)

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

fenstrat’s picture

Version: 7.x-3.19 » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Closed (fixed) » Patch (to be ported)

Needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-3.19
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Fixed

Committed and pushed 3e14853 to 8.x-4.x. Thanks!

Status: Fixed » Closed (fixed)

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