Languages

Configure Languages

Language settings live in template-x.config.json and can also be edited from the TemplateX admin screen.

Config File#

jsontemplate-x.config.json
{  "languages": {    "enabled": true,    "default": "en",    "postTypes": ["page", "post"],    "seo": true,    "globals": true,    "items": [      {        "code": "en",        "locale": "en_US",        "label": "English",        "flag": ""      },      {        "code": "nl",        "locale": "nl_NL",        "label": "Nederlands",        "flag": ""      }    ]  }}

code is the URL prefix. locale is the WordPress locale used for gettext strings, dates, and other locale-aware output.

Admin Settings#

In WordPress admin, open TemplateX > Settings, switch to Extensions, and enable built-in multilingual support in the Languages section.

Add language rows with a URL prefix and locale. The first row is the default language.

Rebuild the theme after enabling languages or changing language rows so the generated runtime contains the updated language configuration.

Turning Languages Off#

When multilingual support is turned off and saved, TemplateX hides the language dashboard, translation editor, language filters, language routes, and translation save handlers.

If the active theme's compiled runtime file is not writable, rebuild the theme after saving.