We are currently adding multilanguage support (internationalization) to the ERPNext website. This is what we have planned, we are looking forward to your feedback.
Adding the Language Picker to the Navigation on the Website
I would integrate this language picker https://bootsnipp.com/snippets/mprMM flag icons can be defined in the backend but we would suggest using https://www.gosquared.com/resources/flag-icons/ which is under MIT license. The flags would be in the current
Language DocType, we should also consider uploading the flag icons with 25px to Frappe Core for usage wherever people want and populating the Flags field with those by default.
Currently the navigation looks like this:
I would add the language picker betweeen the login and the navigation like this mockup (collapsed):
When the user clicks the language they can pick among the available language options (expanded):
Adding Languages to Website Settings
Website Settingsadd a new section called
- Add checkboxes
Enable Multilanguage Supportand
Display Language Picker in Top Bar. Without Multilanguage Support being enabled we hide the language features in blogs, knowledge base and pages.
- Add a new child table
Website Languageswith fields Language (Link: Language), Route (Data), Default (Check, unique)
The route would be a default prefix that is added to the individual
Help Article or
Blog Post route for example the “Company History” pages route in English would be route “/en” and then “company-history” so
www.website.com/en/company-history while the German could be
www.website.com/de/unternehmensgeschichte. This is SEO friendly.
Changes in Other DocTypes
This example is for
Web Page, similar procedure would have to be done for
Help Article and for
Website Settings -> Enable Multilanguage Support == TRUE.
- When creating a new
Web Pageby default put in the default language from
Website Settings -> Website Languages -> default.
Web PageLanguage not the default language, add new field
Translation of Web Page(Link: Web Page) which will link the translations with its parent.
Web Pageshow linked translations in Dashboard
How Language Switching Works
- If the user is logged in we also change his language preference in his user under
- Open the page of the translation of the source site, if you are on the home page in English you should switch to the home page in German. If you are on the contact page in English you should switch to that in German. If there is no translation for that site display the default languages site.