Change language of days

Hello.

I have a problem with language (from English to Slovenian) of a date in Modx.

I add the line “setlocale(LC_ALL, ‘sl_SI’);” in config.core.php file but it’s still the same.
I also tried to add line “” on page but still nothing.

When I open any page, and click on “inspect”, i have “” on the top, but the days are still written in English.

Thanks for help.

Have you tried changing the system setting with the key “locale”?


I changed value to “sl” but days are still in english.

I use the value de_DE.UTF-8 to set it to german.
I don’t know what the correct value is for slovenian but maybe sl_SI.UTF-8?

I changed it to sl_SI.UTF-8 and it’s still not working.

How do you ouput the dates?

I did a test with the value sl_SI.UTF-8 for locale and the string [[*publishedon:strtotime:date=`%A %d. %B %Y`]] in the template and that seems to work.

I copied your example to my template and i got “Friday” again.

Have you tried calling @halftrainedharry 's code uncached?

ie: [[!*publishedon:strtotime:date=%A %d. %B %Y]]

Yes. I also manually deleted cache in modx and i’m using incognito mode in browser.

But again I got English day and month.

Locales need to be installed on the server to work. If you have SSH access, running this command on the server will give you a list:

locale -a

It sounds like Slovenian isn’t installed yet.

1 Like

With “sudo locale-gen sl_SI.UTF-8” I successfully installed it and now it works.

Thank you :slight_smile:

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.