First i want to thank to Sun for this lifesaver module; it is the one of a few modules i install first(Wysiwyg and ImageAssist are my other two favorite "Sun module"s.).

My problem is:
I have a bilingual web site. English is also admin language and Turkish is default language. Almost eveything is OK with Administration menu and Internationalization modules but when i log in as admin, all Administration menu's URLs take "tr" prefix. Administration menu items, content and all other things are English as supposed to be; but Administration menu URLs take "tr" prefix instead of "en".

Example:
http://www.mysite.com/tr/admin/config/administration

To fix that, every time i login, i copy this link http://www.mysite.com/tr/admin_menu/flush-cache/admin_menu and change "tr" to "en" http://www.mysite.com/en/admin_menu/flush-cache/admin_menu then flush Administration menu cache.

I am not sure if whether this is an issue or something i miss. I searched issues with relevant keywords but could not find any similar issue.

Thanks in advance.

Comments

ErgunK’s picture

I found a temporary solution:

To login using http://www.mysite.com/en/user instead of http://www.mysite.com/user.

It seems Administarion menu creates URLs for default language in login and then can't change it to suit admin language.

sun’s picture

Can you try the patch whether patch in #1259486-4: Administration menu disappears when logged in to Google (yes, Google) changes anything?

ErgunK’s picture

I wanted to try the patch(I know nothing about patching but i think i could manage it by manually adding/removing lines since it is a litte/simple patch) but i couldn't reproduce the issue. I thought, i did several updates since i posted this issue and these updates might have solved the problem. Then i saw a new update for Admin Menu(admin_menu 7.x-3.0-rc2), i applied it. After update, issue came back. I think admin menu uses default language(instead of admin menu language) for path prefix after you navigate to http://www.example.com/?q=admin page after updates etc.

After i saw issue, i tried to apply the patch. Downloaded admin_menu.module, opened it in notepad and changed lines as follow:

I found this in line 415 in admin_menu.module (it was in 381th line before update)

if (!empty($_COOKIE['has_js']) && strpos($_GET['q'], 'js/admin_menu/cache') !== 0) {

and replaced it with the line below (according the patch)

if (!empty($_COOKIE['has_js']) && strpos($_GET['q'], 'js/admin_menu/cache') === FALSE) {

Then i deleted original admin_menu.module file, replaced patched one, run update, cleared caches... Unfortunately issue remains the same.

sun’s picture

Please also try the patch in #442560: Admin menu disappears (randomly), needs either cache to be emptied on every page or page refresh several times

You will not be able to apply that manually, so see http://drupal.org/patch/apply for instructions.

sun’s picture

#442560: Admin menu disappears (randomly), needs either cache to be emptied on every page or page refresh several times has been committed to 7.x-3.x. Can you test the 7.x-3.x branch using git - or alternatively, if you don't have git, the 7.x-3.x-dev development snapshot tomorrow (after the snapshot has been re-created)?

ErgunK’s picture

I installed this dev version: http://ftp.drupal.org/files/projects/admin_menu-7.x-3.x-dev.tar.gz

It is the same; after installing and enabling module, Admin Menu uses default language's path prefix instead of Admin language.

But this time i noticed all links in admin pages(i mean other links on page, not only admin menu) took default language prefix.

I think this issue probably is about i18n, not Administration menu. Module translation update(which performs automatically after any module installation) might causing the change of path prefixes on admin section. For example: My site's default language is Turkish but admin language is English. After installing+enabling a module, Multilingual / Internationalization modules downloads Turkish po files and updates strings and it seems this procedure also causes path prefixes of all links in admin section(so Admin Menu) change to tr(as a bug).

I keep investigation/testing and if i find anything new about this issue, i will share here.

PS: It is not related to this issue but some admin menu links(Configuration, Reports etc...) get lost time by time after last 2 updates. They came back after flushing caches.

sun’s picture

@Mediasaur: I'm not sure whether that wasn't too early -- it looks like the snapshot was rebuilt just now, so you might have tested the old code that didn't include the change from aforementioned issue. (it's only contained if admin_menu.module contains the string "admin_menu_deliver")

EDIT: eh, or just look at its version number; must be 7.x-3.0-rc2+3-dev. ;)

ErgunK’s picture

I installed this http://ftp.drupal.org/files/projects/admin_menu-7.x-3.x-dev.tar.gz, i am sure because that is the link i also pasted to install module textbox. :)

Now, I just uninstalled Admin menu, cleared caches and re-installed http://ftp.drupal.org/files/projects/admin_menu-7.x-3.x-dev.tar.gz (this time its date: 2012-Apr-25). It is the same; all links' path prefixes in admin module page changed from "en" to "tr" after enabling new module.

But after i flushed "only" Administration menu cache(i copy http://www.example.com/tr/admin_menu/flush-cache link, change "tr" to "en" and use), all links on the page took "en" prefix back. I thought "/en/admin_menu/flush-cache" would clear only Administraton menu cache. I'm confused.

sun’s picture

Title: Administration menu language path prefix problem. » Administration language not taken into account
Version: 7.x-3.0-rc1 » 7.x-3.x-dev
Component: Miscellaneous » Code

My site's default language is Turkish but admin language is English.

Oh. That's a very special case. How do you accomplish that? Is there a module or special configuration option in i18n or any other module to configure a specific language for administrative pages?

ErgunK’s picture

Sorry for answering late; i am switching from XP Pro to Ubuntu those days; lots of problems, lots of things to do.

I set it in /admin/config/regional/language page. This screenshot shows my language settings:

Language settings

sun’s picture

Can you clarify which module adds the "Admin" column that is visible in the screenshot in #10?

I've looked into i18n's code base, but wasn't able to find any code in there that does this (but also didn't check all submodules).

ErgunK’s picture

Administration Language module.

From project page:

This module lets the administrator see all administration pages in her preferred language.

I thought it was part of i18n module group but just noticed it was not.

sun’s picture

Ah, thanks. That's kind of a hack. Not supported by default currently, since the admin menu is loaded from the client-side on a non-admin path (js/admin_menu/cache/*).

To work around this, you could disable admin_menu's client-side caching in the module settings. That should probably fix the issue.

If that's the case, then I'd probably suggest to close this issue.

ErgunK’s picture

I unchecked "Cache menu in client-side browser" on Administration menu page, cleared caches(both Drupal site and browser) and tried twice to make sure, but issue remains the same. :(

It is not a big problem for me, doesn't effect site management and content production directly(at least for my sites); and i still don't know which module causes this issue; so please you decide how to change issue status(and/or related project).

sun’s picture

Do you happen to have a preferred language configured for your admin user account? (check on user/%/edit)

ErgunK’s picture

FileSize
29.79 KB

English is set for all admin language options:

admin-lang

(In Administration Language section, module checks first option even i check English)

Kasper Souren’s picture

I'm also experiencing this, but only when "Keep menu at top of page" is checked (which unfortunately I need to because of #1588158: admin menu showing at bottom). I hope this can be a good hint towards a solution :)

marinoszak’s picture

I am using administration menu too and i have a similar problem.
My case is that when i turn language into Greek, some menu items disappear.
Although when i turn off Cache menu in client-side browser lost menu items come back and my problem gets solved.

Kasper Souren’s picture

Thanks, marinoszak, when turning of the Cache my menu is also back in English!

dmsmidt’s picture

Title: Administration language not taken into account » Support Administration Language module
Assigned: Unassigned » dmsmidt
Category: Bug report » Feature request
Issue summary: View changes

This is a long standing issue, and still doesn't seem to work flawlessly. There is a feature request in the admin_language queue #2771987: Administration Menu compatibility, but I think it is easier to fix this from within admin_menu.

dmsmidt’s picture

Status: Active » Needs review
FileSize
1.19 KB

Here is a patch for admin_language support.

Note: for this to work you need to disable client side caching.