sulu-workshop icon indicating copy to clipboard operation
sulu-workshop copied to clipboard

04 - Add additional languages to the website

Open luca-rath opened this issue 4 years ago • 0 comments

Add additional languages to the website

Goal

Our website is gaining traction in germany and france. To communicate with our new users in their native language we want to add german an french as additional languages and translate our existing content.

Steps

  • Add the new languages to the config/webspaces/example.xml file
  • Run bin/console sulu:document:initialize to initialize the new languages
  • Change the url configuration in the same file
  • Log into the admin UI with user "admin" and password "admin"
  • Give the admin user permissions for the new languages (Contacts -> Edit Adam Ministrator -> Permissions -> Roles -> Add new languages).
  • Add content in the new languages
  • Implement a language switcher in your templates/base.html.twig

Hints

  • Use {{ dump(urls) }} in the Twig template to find out how Sulu provides urls for multiple languages

More Information

As Sulu is built for internationally focused companies, managing localized content is a core feature of the system. Sulu does not only handle different languages, but also allows to manage different variations of a single language among different countries.

Available localizations for the content of the website are defined in the webspace configuration file.

Links

luca-rath avatar Jul 07 '20 10:07 luca-rath