I have a simple ESPHome system with a ESP32S2 and a ILI9341 TFT display.
This works fine, but I would like to print weekdays on the display translated into my native language.
I found this example from ChatGPT, but get an error message.
You’re really better off going to the actual documentation then using something like ChatGPT that has been trained on several year old data and is incapable of actually knowing if it’s giving you correct answers or not.
There’s information in the documentation on how to use strftime to get the text of the day of the week or month, including information on how to make sure you get it back in your locale too. Specifically, there’s a link in the documentation to another site that tells you how to modify the parameters to get local language stuff back:
I already know how to get & print the time, date weekday etc in english (i have done that many times), and that works fine, but the problem is the translation of months & weekdays, and I cant find how to do that in the link you supplied,…
Can you please be a little more specific about where in the link content I can find this and how to use it (that would be a great help…)…
In that second link, scroll down and you’ll see the following text:
" Note: Yellow rows indicate specifiers and sub-specifiers introduced by C99. Since C99, two locale-specific modifiers can also be inserted between the percentage sign (% ) and the specifier proper to request an alternative format, where applicable"
Following those instructions should, in theory, give you the text in your local language.
I looked into this and tested, and unfortunately this does not seem to work for full weekday names or full month names…( using the suggested solution still presents them in english…)