MODX Globalization for Multiple Languages

July 8, 2015 Ayman El Badawy

MODX is an open source Content Management System (CMS) based on PHP programming language and it supports both Microsoft MSSQL and MySQL databases. MODx was introduced in 2004, and in 2010, MODX Revolution was released with a completely new structure. The cloud version entered the market a couple of years later.

In this blog, I will discuss the features that allow for MODx globalization in order to handle multiple languages.

 

MODX Globalization and Localization

Terminology

  • MODX uses the term "Lexicons" to refer to Globalization (g11n).
  • Lexicon is a collection of Topics and Entries.
  • Lexicon Topic = a set of Entries.
  • Lexicon Entry = single language pair key/value.
  • Administration module (MODX Manager) is shipped with a built-in tool for string localization.
  • Front end (context(s)) have no built-in tool for localization.

 

How MODX Handles Multiple Languages

Content Management Systems always use one of two approaches to handle multiple languages:

  1. The page in the source language has multiple versions per language and is saved on a database using a unique page ID linked to the parent page (source language). Ex: EPiServer and Sitecore.
  2. Use a separate section per language. For example, a home page in English needs to be physically duplicated and assigned a group of settings to handle a different language. (Each CMS has its own step by step process for handling this approach).

MODX follows the second approach. This approach has certain challenges, but following the CMS steps carefully will guarantee a strong structure that can handle multiple languages without issues.

 

Challenges include:

  • Additional time and effort needed if there are multiple languages, as all the steps will need to be repeated per language.
  • A technical background is needed in order to set language locales and some programming code snippet to handle the way the CMS will detect and display languages based on the client selection or the browser settings.

 

MODX Globalization Best Practices

The CMS needs to first be structured by adding Context per language. MODX uses Context to set each language separately. Admins can create any number of Contexts, one per language. See images below for further information:

 

GPI_MODx_1

 

GPI_MODx_2

 

Each Context must have a basic group of settings in order to enable Multilanguage. The following settings are mandatory:

  • Base URL
  • Culture Key
  • Site Start
  • Site URL

 

GPI_MODx_3

 

GPI_MODx_4

 

Once the above steps are done, a PHP developer must add a routine of code to retrieve the current culture key and switch to the correct Context based on that:

 

GPI_MODx_5

Summary

In this blog I briefly explained the MODX CMS structure and the different approaches that CMSs follow to handle multiple languages. Finally, I detailed the best practice steps to globalize MODX in order to handle multiple languages.

 

GPI Resources on Multilingual CMS and Connectors

Globalization Partners International (GPI) offers custom  CMS translation services connectors to a variety of Web Content Management Systems and Client Relationship Management Systems in order to streamline localization workflows and access translation project information across your enterprise. For more information, see  Multilingual CMS Translation Connectors.

 

You may find some of the following articles and links useful:

 

GPI frequently assists customers with multilingual website design, development and deployment, and has developed a suite of globalization tools to help you achieve your multiple language project goals. You can explore them under the  Translation Portals of our website. GPI also offers  globalization consulting services and internationalization, and can evaluate your application. Consider partnering with GPI prior to localizing or translating your application. This will help you avoid many mistakes and save considerable time and money on your localization projects.

Please feel free to contact GPI at info@globalizationpartners.com with any questions about our language and technology services.  Also let us know if you have any interesting blog topics you would like us to cover in our future blogs.  You may request a complimentary Translation Quote for your projects as well.

 

About the Author

Ayman El Badawy

Ayman is a native Arabic speaker with extensive expertise in Arabic software and website localization. He is a Microsoft Certified professional (MCP) since 2001 and earned several certificates including MCSD, MCAD, MCTS and MCPD. He has over 12 years’ experience in software / websites engineering using Microsoft Programming tools including C#, ASP.NET, SQL Server, Visual Studio and other tools such as HTML, JavaScript, XML, Ajax and others.

More Content by Ayman El Badawy
Previous Article
MODX: Introduction to a Leading Open Source CMS
MODX: Introduction to a Leading Open Source CMS

MODX is one of today’s leading open source CMS platforms and has, since its first release in 2005, adhered ...

No More Articles

Ready to see how easy translating your website is?

Request a Demo