<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:remialcxesans;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Hi Reginald,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>I couldn’t find the post where you describe your problem. I just tried your code, this is the result from QGIS 3.2 (Windows) Python console, auto-locale German Germany (de_DE):<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>import datetime<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>vandaag = datetime.datetime.now() <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>dag = vandaag.day <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>maand = vandaag.strftime("%B") <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>jaar = vandaag.year <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>datum = str(dag) + " " + maand + " " + str(jaar)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>print(datum)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>9 August 2018<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>*but* when I override the locale to nl_BE I still get the same output as with the auto-locale.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=FR style='mso-fareast-language:EN-US'>import locale<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=FR style='mso-fareast-language:EN-US'>print(locale.getlocale())<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>(None, None)<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>So I believe the locale is somehow not determinable for Python and a fallback is used.<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>Doing :<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=FR style='mso-fareast-language:EN-US'>import locale<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=FR style='mso-fareast-language:EN-US'>print(locale.getlocale())<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>(None, None)<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>locale.setlocale(locale.LC_ALL, 'nl_BE')<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>'nl_BE'<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>print(locale.getlocale())<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>('nl_BE', 'ISO8859-1')<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>import datetime<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>vandaag = datetime.datetime.now() <o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>dag = vandaag.day <o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>maand = vandaag.strftime("%B") <o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span style='mso-fareast-language:EN-US'>jaar = vandaag.year <o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span style='mso-fareast-language:EN-US'>datum = str(dag) + " " + maand + " " + str(jaar)<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>print(datum)<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>9 augustus 2018<o:p></o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-align:justify'><span lang=EN-GB style='mso-fareast-language:EN-US'>does the trick though. There should be a way to get the set locale from PyQGIS somehow though …<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>Hth,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'>Frank<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b>Von:</b> Qgis-user <qgis-user-bounces@lists.osgeo.org> <b>Im Auftrag von </b>Reginald Carlier<br><b>Gesendet:</b> Donnerstag, 9. August 2018 08:40<br><b>An:</b> Nyall Dawson <nyall.dawson@gmail.com>; 'qgis-user@lists.osgeo.org' <qgis-user@lists.osgeo.org><br><b>Betreff:</b> Re: [Qgis-user] localisation of date fails in QGIS 3.2<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Nyall,<br><br>Somehow my post shows the code but my previous post doesn't.<br>Anyway this is how the code looks:<br><br>vandaag = datetime.now() <br>dag = vandaag.day <br>maand = vandaag.strftime("%B") <br>jaar = vandaag.year <br>datum = str(dag) + " " + maand + " " + str(jaar)<br><br>I suspect that maybe strftime changed in python 3.6?<br><br>Regards,<o:p></o:p></p><div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%" style='width:100.0%'><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%" style='width:100.0%'><tr><td valign=top style='padding:3.75pt 0cm 3.75pt 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%" style='width:100.0%'><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:1.5pt 0cm 1.5pt 0cm'><p class=MsoNormal><span style='font-family:"Tahoma",sans-serif;color:#5C676D'>Reginald Carlier</span><span style='font-family:"remialcxesans",serif;color:#5C676D'></span><span style='font-family:"Tahoma",sans-serif;color:#5C676D'><o:p></o:p></span></p></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:1.5pt 0cm 1.5pt 0cm'><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>Deskundige GIS<o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:2.25pt 0cm 2.25pt 0cm'><p class=MsoNormal><span style='font-size:1.0pt'><a href="https://www.ingelmunster.be/" target="_blank"><span style='text-decoration:none'><img border=0 height=65 style='height:.677in' id="_x0000_i1025" src="http://www.ingelmunster.be/ingelmunster.gif"></span></a><o:p></o:p></span></p></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:1.5pt 0cm 1.5pt 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>Gemeente Ingelmunster<o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>, <o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>Oostrozebekestraat 4<o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>, <o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>8770<o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'> <o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>Ingelmunster<o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:1.5pt 0cm 1.5pt 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'>T<o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'><a href="tel:+32%2051%2033%2074%2039" target="_blank"><strong><span style='font-family:"Tahoma",sans-serif;color:#5C676D;font-weight:normal;text-decoration:none'>+32 51 33 74 39</span></strong></a><o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0cm 0cm 0cm 3.75pt'><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Tahoma",sans-serif;color:#5C676D'><a href="http://www.ingelmunster.be/" target="_blank" title="Website Ingelmunster"><strong><span style='font-family:"Tahoma",sans-serif;color:#5C676D;font-weight:normal;text-decoration:none'>www.ingelmunster.be</span></strong></a><o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:3.0pt 0cm 1.5pt 0cm'><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:1.0pt'><a href="https://www.facebook.com/Ingelmunster/" target="_blank"><span style='text-decoration:none'><img border=0 height=19 style='height:.1979in' id="_x0000_i1026" src="http://www.ingelmunster.be/fb.jpg" alt=Facebook></span></a><o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:1.0pt'><a href="https://www.instagram.com/ingelmunster/" target="_blank"><span style='text-decoration:none'><img border=0 height=19 style='height:.1979in' id="_x0000_i1027" src="http://www.ingelmunster.be/in.jpg" alt=instagram></span></a><o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:1.0pt'><a href="https://www.pinterest.com/ingelmunster/" target="_blank"><span style='text-decoration:none'><img border=0 height=19 style='height:.1979in' id="_x0000_i1028" src="http://www.ingelmunster.be/pi.jpg" alt=pinterest></span></a><o:p></o:p></span></p></td><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:1.0pt'><a href="https://twitter.com/ingelmunster" target="_blank"><span style='text-decoration:none'><img border=0 height=19 style='height:.1979in' id="_x0000_i1029" src="http://www.ingelmunster.be/tw.jpg" alt=twitter></span></a><o:p></o:p></span></p></td></tr></table></td></tr></table></td></tr><tr><td valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:7.0pt;font-family:"Tahoma",sans-serif;color:#000001'><a href="http://www.ingelmunster.be/email-disclaimer.html" target="_blank" title=disclaimer><strong><span style='font-family:"Tahoma",sans-serif;color:#5C676D;font-weight:normal;text-decoration:none'>Raadpleeg onze disclaimer </span></strong></a><o:p></o:p></span></p></td></tr></table></div><p class=MsoNormal>-----Oorspronkelijk bericht-----<br>Van: Nyall Dawson [<a href="mailto:nyall.dawson@gmail.com">mailto:nyall.dawson@gmail.com</a>] <br>Verzonden: donderdag 9 augustus 2018 8:36<br>Aan: Reginald Carlier<br>CC: qgis-user<br>Onderwerp: Re: [Qgis-user] localisation of date fails in QGIS 3.2<br><br>On Mon, 30 Jul 2018 at 19:22, Reginald <<a href="mailto:Reginald.Carlier@ingelmunster.be">Reginald.Carlier@ingelmunster.be</a>> wrote:<br>><br>> Hi,<br>><br>> I have a script that was adapted to python 3.6 and runs fine on QGIS 3.2.<br>> The problem I'm having is that the date shows up in english.<br>> Under Extra > Options > Algemeen i have:<br>> Vertaling gebruikers-interface --> Nederlands<br>> Locale Dutch Belgium (nl_BE)<br>><br>> Also if I choose for "Systeemlocale negeren" (ignore system locale) I still<br>> get the date in english.<br>> My code looks like this and works fine in QGIS 2.18:<br>><br>><br><br>I think you forgot to include the code? Can you re-share?<br><br>Nyall<o:p></o:p></p></div></div></body></html>