The option "Flush all caches" from the Administration menu should never cause translations to be lost, right? Unfortunately, it does in the following scenario (I think these are the contributing factors; the problem is easy to reproduce for me, but rather difficult to nail down exactly):

- default site language is English
- a module contributes a menu item to the main (navigation) menu (in English)
- the admin changes the item's position in the menu by dragging and also translates this menu item into German

After these operations, for a while everything seems ok - the English menu item and page title displayed on the standard site, the German ones on the /de site. However, it only stays good until the next cache flush. After that, either the German translation reverts back to the original completely, or the German translation is kept in the menu block, but lost on the (form) page linked from it. In some instances I also somehow managed for the German translation to be transferred into the menu item definition. Overall, it's like a lottery.

I also find it confusing that the translation at first can be done for the "built-in interface string", but after refreshing through the i18n module, another menu-item-type string appears to be translated. I suspect that they might be interfering somehow. However, no matter how and in what order I translate, I always manage to break it in the actual menu block and/or linked page just by flushing the cache. I end up with a correct-looking translation table and wrong strings displayed in the interface.

Comments

jpl-2’s picture

What I am seeing now is:
1. After logging in to the default language English site, a menu item appears in English, as it should.
2. I go to the German site and the menu item appears in German, as it should.
3. Now flush the cache.
4. Go back to the default language site - the menu item stays in German (wrong).
5. Now flush the cache.
6. The menu item appears back in English, as it should.

To sum up, flushing the cache on the German site makes the menu item on the English site appear in German, until the cache is flushed again.

jpl-2’s picture

Priority: Normal » Minor

After some more observations, I think I've found a workaround. Flushing the cache on the original language site brings the translations back into order. Flushing it on the German language site corrupts them. So the recommended workaround is to translate whatever needs to be translated, flush cache on the German language site to see the effects (if necessary), but always, always finish by flushing cache on the original site.

It's annoying, but tolerable, so I'm lowering the priority from normal to minor.

Anonymous’s picture

Priority: Minor » Normal

This will also occur if someone is in the non-default language and the cache is flushed or outdated.

I wouldn't say that this is a minor problem: If you have a client updating the site and it happens or the site is updated by the general public, it can make the site look broken.

jpl-2’s picture

codecrow, one might argue that you should only perform updates on a site in maintenance mode while it is not accessible. After all, other things might go wrong during an update as well. But you're right that this rule is not always followed in practice, and so the visible (if temporary) breaking problem exists.

YK85’s picture

subscribing - i hope this can be fixed

jpl-2’s picture

I think that this strange behavior only occurs when the menu labels are wrapped in t() in the contributing module's menu hook. Providing the labels unwrapped in English (base language) - as most modules indeed seem to do - and then translating the resulting "Built-in interface" string avoids this problem. So it may be actually a case of API misuse (?) rather than a bug. The only scary part is that if those strings belong to the textgroup "Built-in interface" they may easily collide with other non-menu strings.

dmirtillo’s picture

I agree with codecrow this is not a "minor" issue, cause caches have a set lifetime and when they expire and need to be re-created, this bug happens and i can assure you it is really annoying to see incomplete menus.

idebr’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

This still occurs in version 7.x-1.x, most notably on /node/add

idebr’s picture