The module lacks the ability to have the strings translated, hence its usage is somewhat limited on a multilingual site.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dkliewer’s picture

I've hacked a quick solution which makes the fields translatable (variables module required).

Add the following hook at the end of autoassignrole.module:

/**
* Implements hook_variable_info().
*/
function autoassignrole_variable_info($options) {
  $variables['autoassignrole_user_fieldset_title'] = array(
    'type' => 'text',
    'title' => t('User Role Fieldset Title'),
	'description' => t('The title of the fieldset that contains role options.')
  );
  
  $variables['autoassignrole_user_title'] = array(
    'type' => 'text',
    'title' => t('User Role Title'),
	'description' => t('The title of the field that contains the role options the end user sees during registration.')
  );
  
  $variables['autoassignrole_user_description'] = array(
    'type' => 'text',
	'title' => t('User Role Description'),
	'description' => t('The description displayed to the end user when they are selecting their role during registration.')
  );
  
  return $variables;
}

This enables the three fields for translation via Configuration > Multilingual Settings > Variables
They can then be translated by using Configuration > Variables > Modules > Auto Assign Role

Hess’s picture

Thanks!

SKAUGHT’s picture

here a fix for some of the strings...they just shouldn't be in the variable table.
and a little uninstall of variables too.

EDIT:
sorry i now see the little logic fix won't really help. i don't' take the time to work it out right now, sorry--gotta focus on my own task at hand.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
3.3 KB

The strings_and_minor_logic file in patches in #3 changes some logic that didn't need to be changed, and we already have a working uninstall script per another issue.

This patch reformats the field descriptions from autoassignrole.admin.inc to make translation easier.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Closing this to clean up the issue queue as 7.x-1.0-beta1 was released.

muschpusch’s picture

Status: Closed (fixed) » Active

Sorry for reopening this but the reformatting of the descriptions isn't the issue here. We want the actual values to be translated which #1 fixes. Please have a look at the variable project page

muschpusch’s picture

Status: Active » Needs review
FileSize
1.01 KB

here #1 as a patch but in a seperate file since variable seems to support some lazy loading. Please review!

  • DamienMcKenna committed 33b03c4 on 7.x-2.x
    Issue #1312030 by DamienMcKenna: Fixed field description to make...
mike.davis’s picture

I have updated this patch with the changes to the description field to be a text_format and updated the variables to be in a module group.

  • mike.davis committed bbd94b0 on 7.x-1.x authored by muschpusch
    Issue #1312030 by muschpusch, mike.davis: user strings not translatable
    
mike.davis’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Patch (to be ported)

This has been committed to 7.x-1.x. Need to apply to 7.x-2.x now

  • mike.davis committed 1fe1e1f on 7.x-2.x authored by muschpusch
    Issue #1312030 by muschpusch, mike.davis: user strings not translatable
    
mike.davis’s picture

Status: Patch (to be ported) » Fixed

All committed now

Status: Fixed » Closed (fixed)

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