Drupal - Multilingual content and single language admin interface

On a fresh install, I could get it working that way:

In admin/config/regional/language/detection

  • put Account administration pages on top of Interface text language detection an enable it of course.
  • enable URL method as second choice
  • enable Content language detection and put URL on top of detection methods.

     Home Administration Configuration Regional and language Languages

In user/1/edit language settings :

  • set Administration pages language with your preferred language

There are various issues on D.O about that, maybe this is the most relevant one : When content language detection is different from interface language detection, the detected language is not applied to the rendered content.

Apply these patches :

  • When content language detection is different ... (patch #24)
  • 'Account administration pages' language negotiation causes 'access denied' in toolbar subtree caching (patch #10)
  • Admin toolbar should always be rendered in the admin language (if set) (patch #40)

Empty caches :

  • $ drush cache-rebuild

Language dropdown switcher and everything else seems now to be working fine !

An example of spanish content, strings passed through t() are translated, admin toolbar in english...

An example of spanish content

The same page edited: admin interface fully in english, but content shows the correct translation....

admin interface fully in english, but content shows  the correct translation

Tags:

8

I18N L10N