Hi. If you choose the checkboxes option for auto assign role, the interface is not translatable (only for checkboxes, the other options works well)

This is because fault of t() function in the variables. To patch it you must edit autoassignrole.module and change this:

/**
 * Implementation of hook_user().
 */
function autoassignrole_user($op, &$edit, &$account, $category = NULL) {

in line 201, for the title block:

         $form['autoassignrole_user'] = array(
           '#type' => 'fieldset',
           '#title' => _autoassignrole_get_settings('user_fieldset_title'),
           '#collapsible' => FALSE,
           '#collapsed' => FALSE,
         );

to:

         $form['autoassignrole_user'] = array(
           '#type' => 'fieldset',
           '#title' => t(_autoassignrole_get_settings('user_fieldset_title')),
           '#collapsible' => FALSE,
           '#collapsed' => FALSE,
         );

in line 246:

'#title' => t(_autoassignrole_get_settings('user_title')),
'#default_value' => $edit['user_roles'],
'#options' => $roles,
'#description' => _autoassignrole_get_settings('user_description'),

to:

'#title' => t(_autoassignrole_get_settings('user_title')),
'#default_value' => $edit['user_roles'],
'#options' => $roles,
'#description' => t(_autoassignrole_get_settings('user_description')),

Comments

grasmash’s picture

can you post a real patch for this?

Git patch instructions:
http://drupal.org/node/707484

pokepasa’s picture

I will try to do it.

Learning now how to use git (I never used it before)

pokepasa’s picture

Man, I lost one hour trying to understand how GIT works and I still dont know how to download the code from autoassignrole and make a patch.

I followed this pages, and still unable to see any code to patch:

http://drupal.org/node/1054616
http://drupal.org/node/367392
http://drupal.org/node/1015228

I've installed GIT and I make a local directory to work with autoassignrole, but I apply the commands from the tutorial and nothing happens:

git clone --branch 6.x-1.2 http://git.drupal.org/project/autoassignrole
Cloning into autoassignrole...
remote: Counting objects: 429, done.
remote: Compressing objects: 100% (175/175), done.
remote: Total 429 (delta 286), reused 370 (delta 251)Receiving objects:  73% (31

Receiving objects: 100% (429/429), 107.50 KiB | 76 KiB/s, done.
Resolving deltas: 100% (286/286), done.
warning: Remote branch 6.x-1.2 not found in upstream origin, using HEAD instead

But my working directory is still empty. Also:

git branch 1-checkboxes_not_translatable

Launch error: git branch 1-checkboxes_not_translatable

Some tips are welcomed.

grasmash’s picture

The issue is that you're specifying an invalid branch.

Drupal's naming conventions dictate that you name branches in the pattern "6.x-1.x", leaving the last digit off in favor of the 'x'. The last digit is used to designating an actual release, which is done with tags. So, '6.x-1.x' would be the branch where on going development takes place, '6.x-1.2' would be a release tag designating a specific snapshot of the '6.x-1.x' branch.

In any case, you can always just copy and paste the required git clone command from a project's version control tab. Visit:
http://drupal.org/project/autoassignrole/git-instructions

It gives you the option of choosing from the 6.x-2.x or 6.x-1.x branches, and will generated the necessary git command based on your selection. For 6.x-1.x, the command would be:

git clone --branch 6.x-1.x http://git.drupal.org/project/autoassignrole.git
cd autoassignrole

Hope that helps!

pokepasa’s picture

Hi Mad.

After 2 hours of trying, finally I understood how I was failing with the f*&$ing GIT, that no one explain: in Windows, when you install GIT (with GUI and Bash), the GUI console open an empty repository and this drives me crazy, until I was able to understand that the command
git clone --branch 6.x-1.x
creates another repository:
I was looking for files in an empty repository with GUI interface, while I must choose to open an existing repository in the path git/autoassigrole, that was the repository that the "git clone" command create.

Well, I used the master branch for commiting changes, but I dont know if changes are uploaded automatically or not (I only make a "stage" and a commit in the GUI interface)

I can see my changes in the master branch, that are this I put here. I don't know if this is what you want or I need to do extra steps.

---------------------------- autoassignrole.module ----------------------------
index d37eb00..27be455 100644
@@ -197,7 +197,7 @@ function autoassignrole_user($op, &$edit, &$account, $category = NULL) {
         if (count($roles)) {
          $form['autoassignrole_user'] = array(
            '#type' => 'fieldset',
-           '#title' => _autoassignrole_get_settings('user_fieldset_title'),
+           '#title' => t(_autoassignrole_get_settings('user_fieldset_title')),
            '#collapsible' => FALSE,
            '#collapsed' => FALSE,
          );
@@ -242,7 +242,7 @@ function autoassignrole_user($op, &$edit, &$account, $category = NULL) {
              '#title' => t(_autoassignrole_get_settings('user_title')),
              '#default_value' => $edit['user_roles'],
              '#options' => $roles,
-             '#description' => _autoassignrole_get_settings('user_description'),
+             '#description' => t(_autoassignrole_get_settings('user_description')),
            );
          }
          if (_autoassignrole_get_settings('user_required')) {
pokepasa’s picture

Issue summary: View changes

To add translation for block title