fix tests and fixes #2867
fixes #2868
Merge pull request #2869 from digi604/fix-2867

fix tests and fixes #2867 (redirect preview only in edit mode)
If the language menu isn't present, don't change it.

As per PR #2651, the language menu was disabled (not rendered) if the settings.USE_I18N is False. Previously, code would alter that menu, whether or not it was present, resulting in a mis-formed language menu.

This PR adds a new public API for the toolbar get_menu(), which operates like get_or_create_menu(), except that it will return None if the menu is not found.

Docs also updated.

Tests pass.
authors change
Merge pull request #2870 from digi604/fix-2868

fixes #2868
Merge pull request #2873 from mkoistinen/fix_phantom_language_menu

If the language menu isn't present, don't change it.