Summary
I am trying to set up a bi-lingual website for English and Macedonian (yes, you read that correctly. Our church has an outreach to North Macedonia.)
I am working on XAMPP 8.2.12 ( Apache 2.4.58; MariaDB 10.4.32; PHP 8.2.12 (VS16 X86 64bit thread safe) + PEAR; phpMyAdmin 5.2.1) on my Windows 11 laptop, and I have installed MODX 3.2.0.
I have read that there are two ways to do this, both using a different Context for each language, but one using a gateway plugin to switch contexts and the other using the XRouting plugin. I have tried both, and am experiencing a similar problem with both.
I’ll give the details of the XRouting attempt.
(NB. I had lots of screen dumps, but I was only allowed to use one!)
Step to reproduce
I have set up two Contexts, ‘eng’ and ‘mak’ in addition to ‘web’, with Context Settings as follows:
Under Area: (none)
base_url /en/ or /mk/
http_host localhost/bandf2
site_start 2 or 3
site_url http://_localhost/bandf2/en/ or …/mk/ {I inserted the underline here so that it did not create a link in this post}
Under Area: Lexicon and Language
cultureKey en or mk
I have created two subfolders, ‘en’ and ‘mk’, into which I have copied .htaccess, index.php, and config.core.php, and amended the English one as follows, with the equivalent for the Macedonian one:
.htaccess
RewriteBase /bandf2/en/
Index.php
if (!defined(‘MODX_CORE_PATH’)) {
define(‘MODX_CORE_PATH’, dirname(dirname(FILE)) . ‘/core/’);
}
/* Initialize a context - this one is for ‘eng’ English Language */
$contextKey = ‘eng’;
Config.core.php already had the correct core path and did not need to change
define(‘MODX_CORE_PATH’, ‘C:\xampp\htdocs\bandf2/core/’);
I set up a home page for each of the new Contexts: English no.2, Macedonian no. 3
In the Home(1) page I have entered a link to each of the other two home pages:
English home page - href=”[[~2]]
Macedonian Home Page - href=”[[~3]]
I have installed the current version of XRouting - 1.4.1-pl, with system events set including OnHandleRequest
Observed behavior
At this point, I would assume that we are ready to go.
· I have my Contexts
· I have my subfolders
· I have my home pages
· I have my routing plugin
However, when I go to my ‘web’ Home Page (1) and click on [view] I get the following:
The URL should be: localhost/bandf2/index
On the other test, where I was using the gateway plugin and amended .htaccess, it came up with a similar error, but the displayed URL was: localhost/mk
Expected behavior
The problem would appear to be that whatever is building the URL is doing it incorrectly.
I would suspect that there is something missing in my build, but I have followed the instructions that I found online for this:
Using XRouting for multilingual websites in MODX | MODX.today
Multilingual websites with MODX - Nathanael McMillan
Any hints, tips, or other guidance would be much appreciated.
Thanks in advance to anyone who can help.
Environment
MODX 3.2.0 running on XAMPP 8.2.12 ( Apache 2.4.58; MariaDB 10.4.32; PHP 8.2.12 (VS16 X86 64bit thread safe) + PEAR; phpMyAdmin 5.2.1) on my Windows 11 laptop.
