Hello,

I have written a patch that provides the ability to translate the local tasks / tabs to the admin language using hook_menu_local_tasks_alter(). I feel like my method may be a little "hackish", however I wasn't able to come up with a better way of doing it, so if anyone has any alternative suggestions that would be great as well.

In order to accomplish this functionality, I also needed a better way of retrieving the current user's administration language than the admin_language_preferred() function provides, so I also created a new admin_language_retrieve() function.

I also added a "Translate local tasks" option to the admin language config page, so that my functionality can be enabled or disabled.

My patch is attached.

Comments

Scott Robertson’s picture

StatusFileSize
new4.57 KB

Rerolling patch for the latest dev release.

prophet108’s picture

This to me is an important, missing feature. Would the maintainers consider either this patch or a better approach?

phily’s picture

Works for me using Admin Language 7.x-1.0-beta1 but only with super user (uid 1).
Less powerfull roles see non translated tasks.
Thanks for the patch.

phily’s picture

StatusFileSize
new15.56 KB
moonray’s picture

@PhilY Did you try setting the "display admin pages in another language" permission?

phily’s picture

@moonray : yes, so there might another setting I missed somewhere ;-)
PS: I'm using 7.x-1.0-beta1+2-dev with this page comment #1 patch.

banoodle’s picture

Patch worked great for me (thanks!)

After upgrading to latest dev release and applying the patch at #1, I had to go to /admin/config/regional/language/admin_language and enable the new setting at the bottom for "Translate local tasks"

Looking good!

phily’s picture

Surprisingly, it now works for all users with nothing more than last post.
Anyway, thanks @Scott for the good job.

jlballes’s picture

Thanks! Works for me

dawnbuie’s picture

This is amazing! it works. Should be part of core. Thank you very much for sharing.

rikvd’s picture

Status: Needs review » Reviewed & tested by the community

for a few month's in production, works like a charm

stefan.r’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x-1.x, thanks!

Status: Fixed » Closed (fixed)

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