When translating the action name in Bulk Operations to another language the drop down list or the buttons controls are malfunction. To overcome this problem i edited again the view and in the bulk operation settings i reselected the translated actions and it worked again.

I think the actions should not be reselected after translation.

Regards,

Comments

infojunkie’s picture

How did you translate the action names? Please explain the process in detail.

ali.khairat’s picture

The Translation was done by enabling Locale module and Localization client module, then i searched for the text i want to translate and translate it.

infojunkie’s picture

Assigned: Unassigned » infojunkie

Thanks, I'll try it this way.

a.medhat’s picture

Assigned: infojunkie » Unassigned

nice observation ali it happens to me too

infojunkie’s picture

Assigned: Unassigned » infojunkie
infojunkie’s picture

I wasn't able to reproduce this behavior on my side. Here's what I did:

* Enabled Localization Client and Locale modules
* admin/settings/language/add: added Arabic language
* admin/settings/language/overview: selected Arabic to be default language
=> The screen went RTL
* admin/content/node2: clicked "TRANSLATE TEXT"
* Selected "Change node author" in PAGE TEXT list
* Translated it to "مؤلف جديد" and pressed "Save translation"
* Pressed CTRL+F5 to refresh the page
=> The action "مؤلف جديد" was listed in the available actions

Did you do something different or am I overlooking something?

Note that VBO changed its method of storing actions between 6.x-1.4 and 6.x-1.5. In the new storage system, modifying the action's label (as we did here) should not affect the storage.

ali.khairat’s picture

Yes actually i forgot to say that it happens for the actions that i write in the code.

here is a sample of the action looks something like this:

function hook_action_info() {
return array(
'action' => array(
'description' => t('Modify User'),
'type' => 'user',
'configurable' => FALSE,
'hooks' => array(
'user' => array('load'),
),
),
);
}

When i try to translate the word "Modify User" to "تغير عضو" the drop down list gives a lot of ones and strange things.

infojunkie’s picture

Can you please try the steps I sent above on the default VBO and let me know if you see the same behaviour?

The "ones" that you report after translation are typical of the old version of VBO... maybe you have two overlapping versions of the module in 2 different folders?

ali.khairat’s picture

Did you read my last reply #7 i told you that it works fine for the default actions however for actions that i implemented in my module it does not work.

infojunkie’s picture

If you want to say that it happens only for your own actions, you have to write the word "only". Otherwise I cannot know whether your tested it with default actions or not.

Since it happens only for your own actions, please post the code here, maybe we'll find something missing.

ali.khairat’s picture

OK sorry for the misunderstanding i thought you got my point from the beginning.

Action Info

function hook_action_info() {
  return array(
    'modify_user_action' => array(
    'description' => t('Modify User'),
    'type' => 'user',
    'configurable' => FALSE,
    'hooks' => array(
      'user' => array('load'),
      ),
    ),
  );
}

Action

function modify_user_action(&$object, $context = array()) {
  //modify the user
}
infojunkie’s picture

I tried your hook_action_info() above in a new test module. The label was translated fine.

We'll need to debug the module. In file views_bulk_operations_plugin_style.inc, function get_selected_operations(), VBO constructs the list of actions that it will display in the view. Make sure you have devel.module enabled, then insert the line

dsm($selected);

before the function's return statement.

If you find your action's label is wrong, try to remove the t() function in the line

$selected[$key] = t($this->options['all_operations'][$key]['label']);

What do you get?

owahab’s picture

Hello Karim.

Thank you for the immense effort you're putting in this amazing module.

I am not sure this could be a solution for the issue but isn't it a good idea to remove the t() in the line:

$selected[$key] = t($this->options['all_operations'][$key]['label']);

Thank you.

infojunkie’s picture

Hey Omar! Nice to find you in my issue queues :-)

Yes I think it would make sense in general, since the label is already translated in the hook_action_info().

infojunkie’s picture

Status: Active » Closed (fixed)

Closed unless I hear back from the original poster.

Marko B’s picture

I have the same problem. Added another languge and went to translate dropdows from Bulk Op. With normal translation at admin/build/translate/search
I have 3 ops. promote/demote to f.page and delete node. When i translate even one. next time i see view i have this for drop down besides execute button

<select id="edit-operation" class="form-select" name="operation">
<option class="level2" value="0"> Choose an operation </option>
<optgroup label="339302ab7ef2adc1a3a9844e15e76967"/>
<optgroup label="bs">
<option class="level0" value="jQuery Flash plugin - JavaScript">1</option>
<option class="level0" value="SWFObject 2 - JavaScript">1</option>
<option class="level0" value="Direct embedding - do not use JavaScript replacement">1</option>
<option class="level0" value="Use SWF file directly, no streaming through another SWF.">1</option>
<option class="level0" value="Use custom SWF file.">1</option>
<option class="level0" value="Generic MP3 player">1</option>
<option class="level0" value="Generic FLV player">1</option>
<option class="level0" value="JW Media Player 4">1</option>
<option class="level0" value="Languages">1</option>
<option class="level0" value="Configure languages for content and the user interface.">1</option>
<option class="level0" value="Left to right">1</option>
<option class="level0" value="Save configuration">1</option>
<option class="level0" value="Location chooser">1</option>
<option class="level0" value="Used to activate location choosing using a gmap.">1</option>
<option class="level0" value="Disable dragging">1</option>
<option class="level0" value="Disable keyboard">1</option>
<option class="level0" value="Disable the keyboard shortcuts.">1</option>
<option class="level0" value="Disable mousezoom">1</option>
<option class="level0" value="Disable using the scroll wheel to zoom the map.">1</option>
<option class="level0" value="Disable Continuous Zoom">1</option>
<option class="level0" value="Use AutoZoom">1</option>

...etc

and many more rows.

Also solving it now with selecting actions again and makeing it work, but 10 minutes ago i had crash of localhost and couldnt get it running and then watchdog table had gone bad and had to restore my DB from backup, just while trying to fix this problem with bulk OP so, it could be dang. stuff. Only using local module when translating.

miglius’s picture

I can confirm that upgrading to the dev version solved very same issue on my setup. However, running the update.php script resulted in loss of the selected operations in my views. I had manually alter the views and reselect the operations.