Internationalization

The modmore site is currently only available in English, but this might change in the future.

The most likely candidate is Russian. With modstore and the various Russian community sites, there are a lot of potential customers that are unable of reaching us due to the language barrier.

While there are other challenges that need to be dealt with before we can launch a different language, including the ability to provide support and documentation in that language, we can make launching a new language a lot simpler by consistently using lexicons throughout the site.

Managing Lexicons

Lexicons are located in /src/lexicon/ and follow the standard MODX lexicon structure. English should always be added to the files directly, while for future translations we may use a tool like CrowdIn.

All keys are prefixed with m. to ensure they are unique. The default lexicon topic is automatically loaded. (Note: it may be necessary to set the MODX setting cache_noncore_lexicon_topics to false to ensure changes show up instantly)

The file should be structured in logical sections (navigation, extras, account, dashboard, etc) with keys sorted alphabetically within the sections.

Lexicons in Twig Templates

In Twig templates you can use {{ lex('m.lexicon_key') }} to insert translations.

Lexicons in MODX Templates

In MODX templates and chunks, the tags look like [[%m.lexicon_key]].

Lexicons in JavaScript

As we build the website html-first, there should rarely be a need for JavaScript to access lexicons directly. When this does happen, there are two ways of dealing with it:

  1. Write a <script> tag to the header with an object of key => lexicon values. We may introduce a shared object/handler for this if it becomes necessary.
  2. Add the required lexicons as data attributes to a container.

Multi-lingual Content

For content-heavy pages, we do not yet have a structure to translate the full page. This will likely introduce some naming scheme, or also rely on lexicons.

Language routing

We do not currently route to different languages, as those are not yet available. When they are, they may live on completely different domains (modmore.ru, modmore.nl, etc).