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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | local-tacks.jpg | 15.56 KB | phily |
| #1 | 2188185-admin_language-translate-local-task-1.patch | 4.57 KB | Scott Robertson |
Comments
Comment #1
Scott Robertson commentedRerolling patch for the latest dev release.
Comment #2
prophet108 commentedThis to me is an important, missing feature. Would the maintainers consider either this patch or a better approach?
Comment #3
philyWorks 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.
Comment #4
philyComment #5
moonray commented@PhilY Did you try setting the "display admin pages in another language" permission?
Comment #6
phily@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.
Comment #7
banoodle commentedPatch 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!
Comment #8
philySurprisingly, it now works for all users with nothing more than last post.
Anyway, thanks @Scott for the good job.
Comment #9
jlballes commentedThanks! Works for me
Comment #10
dawnbuie commentedThis is amazing! it works. Should be part of core. Thank you very much for sharing.
Comment #11
rikvd commentedfor a few month's in production, works like a charm
Comment #13
stefan.r commentedCommitted and pushed to 7.x-1.x, thanks!