0

It appears that WPEngine does not have support for different locale strings, rendering setlocale() useless.

setlocale(LC_ALL, "es_ES"); returns false and immediately after that, setlocale(LC_ALL, 0) (as you would expect from the previous false, returns "en_US".

0

The issue with setlocale() is not the function itself. It is that WPEngine only has English language locales installed (the complete list is below) and cannot realistically install any other locales. Because I needed to just print some Spanish language dates (not change the entire WordPress installation to Spanish), I wound up creating an array of the date strings in question and writing a function that parses them if necessary (or sends the result to strftime()):

The array is here:

https://gist.github.com/murdaugh/6734488

The function is here (it gets called just like strftime()):

https://gist.github.com/murdaugh/6735164

And this is the complete list of WPEngine Locales:

en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
0

WP Engine has recently expanded the locales available on their platform. Here is the current list at the time of this reply:

C
C.UTF-8
da_DK.utf8
el_CY.utf8
el_GR.utf8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
es_AR.utf8
es_BO.utf8
es_CL.utf8
es_CO.utf8
es_CR.utf8
es_CU
es_CU.utf8
es_DO.utf8
es_EC.utf8
es_ES.utf8
es_GT.utf8
es_HN.utf8
es_MX.utf8
es_NI.utf8
es_PA.utf8
es_PE.utf8
es_PR.utf8
es_PY.utf8
es_SV.utf8
es_US.utf8
es_UY.utf8
es_VE.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
fr_FR.utf8
fr_LU.utf8
it_CH.utf8
it_IT.utf8
nl_AW
nl_AW.utf8
nl_BE.utf8
nl_NL.utf8
nn_NO.utf8
POSIX
pt_BR.utf8
pt_PT.utf8
ru_RU.utf8
ru_UA.utf8
sv_FI.utf8
sv_SE.utf8

As part of that update, I imagine they should be able to add locales beyond the ones listed above if requested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.