I am using Ubuntu on a Raspberry Pi, had the same problem trying to use portuguese local for date:
setlocale(LC_TIME, "C"); echo strftime("%A"); echo setlocale(LC_TIME, "pt_PT"); echo strftime(" in Portuguese %A");
Then we checked it with the local -a command, pt_PT was not in the list, so I added it sudo / usr / share / locales / install-language-pack pt_PT and run local -a again: there was pt_PT.utf8 . After that, the result is still the same: the output is expected for pt_PT in English. Here is the small difference that made me work:
··· echo setlocale(LC_TIME, "pt_PT.utf8"); ···
So, I had to turn pt_PT into pt_PT.utf8
alexscmar
source share