Hi,
I create a page A with language=german and a menu entry A.
Then I create page B with lang=german and a menu entry B. I create a translation for this page with a menu entry B-eng.
Third, I create a page C with lang=neutral and a menu entry C.
Now, when I'm at page B with german language and switch the language with the flags in the global language switcher block, the page B switches to english content and the menu entry "A" disappears. I Just have B-eng and C in the menu. This works as I expect it.
But when I'm at the lang-neutral page C and klick on the english flag in the language switcher block, nothing changes. Of course C stays because it is lang neutral, but menu entry A does not disappear!
Is that a bug or by design? I would expect all german-only pages/menus to disappear whenever I click on the english flag in the switcher block and not only when I'm on a page that has a translation. Otherwise the global language switcher block doesn't make much sense because it only has effect on pages where I have per-page flags either (i.e. when a translation exists).
cu,
Frank
Comments
Comment #1
Anonymous (not verified) commentedOk, this was partly my fault because of a wrong setting in the Site Configuration/Multilingual System! I set this now to "Current language and no language" and now the german pages disappear when I click on the english flag and vice versa!
But not always! Here's the remaining problem explained better I hope:
Step 1:
I click on the german flag in the language switcher. Now my menu is:
A
B
C
C show a language neutral page, A is german without translation, B is english with english translation "B-eng".
Step 2:
I click on C and watch the page C. Now I click on the english flag in the language switcher block. My menu becomes
B-Eng
C
Thats fine!
Step 3:
Now I switch back to german and click on A, i.e. I watch the german page A and have menu
A
B
C
Step 4:
While wachting page A, I click on the english flag again. Now nothing changes. My menu still is
A
B
C
but the path changes from http://bla/node/31 to http://bla/en/node/31, although still showing the german page A.
Step 5:
Now I click on C. And at this moment, the menu changes to
B-Eng
C
I think this is not a good solution. I understand that in Step 4 drupal keeps showing page A, because there is no english translation of it and instead of showing a 404 error or sth. it keeps showing the german page.
BUT in step 4 the menu should change immediately when clicking on the english flag. That should not be delayed until I click on menu entry C in step 5.
Comment #2
AaronCollier commentedI don't think you need to have as many steps as this. I have the same problem. All it takes is one step.
Go to any page that is in English but not in Czech. Click on the Czech button. All content that can be translated is, all content that is only Czech appears in the menu.
But the menu will continue to show all only-English items. I think it's related to the same problem of keeping the only-English page there, and not displaying a 404 page.
Comment #3
Anonymous (not verified) commentedI guess thats not the same behaviour. When I'm at a page that is only in English and not in German and click on the german flag, nothing changes. Not even the menu. It stays all the same with all english-only entries. Only when I then click on the menu at a page that has both languages, then all of a sudden the menu switches all its entries from english to german.
Your problem that after clicking on the Czech button you get the Czech-only menu items, but the English-only items also remain in the menu, is likely related to the settings. Go to Site Configuration/Multilingual System and chose "Current language and no language". Then you will only have either the Czech-only or the English-only menue entries.
But my problem is that the menu doesn't change when I click on the language flag while I'm at a page that has a language but no translation to the other language.
Comment #4
AaronCollier commentedI have selected "current language and no language" (actually "only current language and no language"). That is what I get when I click on a page that is both English and Czech.
The rest of the menu doesn't change when I am on a page that isn't in that language, which I believe is exactly what you are describing. If you had things that were only in English you would see what I meant.
You only need one step for it, and I think it's the same as not displaying a 404 page.
Comment #5
Anonymous (not verified) commentedHmm, the behaviour here has indeed changed. After I configured a lot and reinstalled the i18n module for other reasons, it behaves exactly as you describe which is still different from what I was seeing before.
I think it would be a nice feature for i18n if one could define a default error page that is in the language for which no translation exists and would show sth. like
"There is no translation for this page yet. Please create a translation of set the page to "language neutral" to view it with the current language selection"
If such a page existed and was linked from the language flag, the menu would switch the right way, just like if a translation existed. And such a page would be helpful also, I guess.
Comment #6
AaronCollier commentedThat might be a useful thing to have. I have now idea how easy it would be to implement. You'd have to have separate ones for each language, I assume.
Comment #7
Anonymous (not verified) commentedI guess it should not be that hard. I was able to hack that into my own little language switcher block that I created to show switchers for all but the current language (see http://drupal.org/node/242646), but of course this is just a dirty hack that works for me with my i18n and my language settings. I've no idea how general that is.
I just send the user to a predefined error page when no translation exists. You should create such a page for all languages and give it the same alias, see below. Then it works with my language settings of "Path prefix only". Since the error page is in the right language, the menu switches as expected.
Someonw with better knowledge should be able to make the href path configurable, for instance, or realize the dynamic solution (sketched in the comments below). But maybe this snippet helps some people for now.
Comment #8
hass commentedI haven't read all this many comments, but the topic is very old and sounds like you are searching for http://drupal.org/project/translation_overview. If you still think this is an issue, please reopen.
Comment #9
AaronCollier commentedTranslation Overview is a nice module, but I'm not sure it addresses this issue. This issue isn't about an overview of the situation, but what happens when an individual page without a translation is clicked on.
Comment #10
hass commentedCome back if you know for sure that translation overview does not address this issue and please explains why not, please.
Comment #11
AaronCollier commentedI installed Translation Overview and none of the behavior described here changed.
I go to a page in English that has no translation. Then I click the language flag. What happens is the menus, etc., change but the content remains in English. What this issue was asking for was for the content to change to something like "there is no translation for this page, please click here to start one" (in the target language). The block would send people to a specific page.
The problem was the presence of English on a page that said it was in German. This is a problem for a variety of reasons, including for accessibility, since the content is not labeled as English so assistive technology would still read it as German.
I do not think this is the highest priority request, but it is not a support request nor does translation overview do it. If you want to change it to "won't fix", that would seem possible.
Comment #12
castawaybcn commentedperhaps what you are looking for is this http://drupal.org/project/translation404
Comment #13
jose reyero commentedRight, that is the module, which is also linked from i18n front page, btw
Comment #14
Anonymous (not verified) commentedThis does not seem to work in Drupal 6.14
Fatal error: Call to undefined function i18n_translation_link_alter(