Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Frank Broniewski
My take on getting the locale from Qt and setting it in Python:

 

import locale

 

def get_qgis_locale():

loc = QLocale()



for lang in loc.uiLanguages():

if lang.startswith(loc.bcp47Name()):

return '%s.UTF-8' % lang.replace('-', '_')

return 'en_US.UTF-8'

 

locale.setlocale(locale.LC_ALL, get_qgis_locale())

print(locale.getlocale())

 

uiLanguages() is a bit ambiguous, when using auto locale it just shows ‘de’ for 
me, setting 

the override – not the user interface – to nl_BE it shows ‘nl-BE’ which should 
be enough for setting locale.setlocale, you just need to replace the dash with 
an underscore. There is still the possibility that this will break on some 
language combinations though.

 

Frank

 

Von: Qgis-user  Im Auftrag von Alessandro 
Pasotti
Gesendet: Donnerstag, 9. August 2018 09:30
An: Reginald Carlier 
Cc: qgis-user@lists.osgeo.org
Betreff: Re: [Qgis-user] localisation of date fails in QGIS 3.2

 

On Thu, Aug 9, 2018 at 9:23 AM, Reginald Carlier 
mailto:reginald.carl...@ingelmunster.be> > 
wrote:

Thanks a lot Alessandro,

 

That works perfectly.

 

Glad it helped.

 

 

btw, this is a side-effect of the recent changes in QGIS locale: we are now 
using setting a "default locale" (from QGIS settings) when QGIS starts, and 
that locale is used through the whole QGIS application.

 

If you change the default locale in the settings, please remember to restart 
QGIS.

 

 

 

 





Reginald Carlier



Deskundige GIS



 <https://www.ingelmunster.be/> 




 <https://www.ingelmunster.be/> Gemeente Ingelmunster

 <https://www.ingelmunster.be/> , 

 <https://www.ingelmunster.be/> Oostrozebekestraat 4

 <https://www.ingelmunster.be/> , 

 <https://www.ingelmunster.be/> 8770

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> Ingelmunster




 <https://www.ingelmunster.be/> T

 <https://www.ingelmunster.be/> +32 51 33 74 39


 <https://www.ingelmunster.be/> www.ingelmunster.be




 <https://www.ingelmunster.be/> 

 <https://www.ingelmunster.be/> 

 <https://www.ingelmunster.be/> 

 <https://www.ingelmunster.be/> 


 <https://www.ingelmunster.be/> Raadpleeg onze disclaimer 

 <https://www.ingelmunster.be/> Van: Alessandro Pasotti 
[mailto:apaso...@gmail.com] 
Verzonden: donderdag 9 augustus 2018 9:10
Aan: Reginald Carlier
CC: Nyall Dawson [via OSGeo.org]; qgis-user@lists.osgeo.org
Onderwerp: Re: [Qgis-user] localisation of date fails in QGIS 3.2

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> Reginald,

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> Using QT:

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> locale = QLocale(QLocale.Japanese)

 <https://www.ingelmunster.be/> locale.toString(QDate.currentDate())

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> And, if you want to use the same settings that 
you set in QGIS, just use the default locale:

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> locale = QLocale() # Default locale from QGIS 
options/settings 

 <https://www.ingelmunster.be/> locale.toString(QDate.currentDate())

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> On Thu, Aug 9, 2018 at 8:54 AM, Reginald 
Carlier  wrote:

 <https://www.ingelmunster.be/> I forgot to mention that I import datetime as 
follows:

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> from datetime import datetime

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> In the console I get the same result as from my 
script.

 <https://www.ingelmunster.be/> Maybe I should use QCoreApplication.translate 
or some other explicit way to tell python to translate a string from English to 
Dutch?

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> Regards,

 <https://www.ingelmunster.be/>  





 <https://www.ingelmunster.be/> Reginald Carlier



 <https://www.ingelmunster.be/> Deskundige GIS



 <https://www.ingelmunster.be/> Fout! Bestandsnaam niet opgegeven.




 <https://www.ingelmunster.be/> Gemeente Ingelmunster

 <https://www.ingelmunster.be/> , 

 <https://www.ingelmunster.be/> Oostrozebekestraat 4

 <https://www.ingelmunster.be/> , 

 <https://www.ingelmunster.be/> 8770

 <https://www.ingelmunster.be/>  

 <https://www.ingelmunster.be/> Ingelmunster




 <https://www.ingelmunster.be/> T

 <https://www.ingelmunster.be/> +32 51 33 74 39


 <https://www.ingelmunster.be/> www.in

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Frank Broniewski
Hi Reginald,

 

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):

import datetime

vandaag = datetime.datetime.now() 

dag = vandaag.day 

maand = vandaag.strftime("%B") 

jaar = vandaag.year 

datum = str(dag) + " " + maand + " " + str(jaar)

print(datum)

9 August 2018

 

*but* when I override the locale to nl_BE I still get the same output as with 
the auto-locale.

 

import locale

print(locale.getlocale())

(None, None)

 

So I believe the locale is somehow not determinable for Python and a fallback 
is used.

 

Doing :

import locale

print(locale.getlocale())

(None, None)

locale.setlocale(locale.LC_ALL, 'nl_BE')

'nl_BE'

print(locale.getlocale())

('nl_BE', 'ISO8859-1')

import datetime

vandaag = datetime.datetime.now() 

dag = vandaag.day 

maand = vandaag.strftime("%B") 

jaar = vandaag.year 

datum = str(dag) + " " + maand + " " + str(jaar)

print(datum)

9 augustus 2018

 

does the trick though. There should be a way to get the set locale from PyQGIS 
somehow though …

 

Hth,

Frank

 

Von: Qgis-user  Im Auftrag von Reginald 
Carlier
Gesendet: Donnerstag, 9. August 2018 08:40
An: Nyall Dawson ; 'qgis-user@lists.osgeo.org' 

Betreff: Re: [Qgis-user] localisation of date fails in QGIS 3.2

 

Hi Nyall,

Somehow my post shows the code but my previous post doesn't.
Anyway this is how the code looks:

vandaag = datetime.now() 
dag = vandaag.day 
maand = vandaag.strftime("%B") 
jaar = vandaag.year 
datum = str(dag) + " " + maand + " " + str(jaar)

I suspect that maybe strftime changed in python 3.6?

Regards,





Reginald Carlier​



Deskundige GIS



 <https://www.ingelmunster.be/> 




Gemeente Ingelmunster

, 

Oostrozebekestraat 4

, 

8770

 

Ingelmunster




T

  +32 51 33 74 39


 <http://www.ingelmunster.be/> www.ingelmunster.be




 <https://www.facebook.com/Ingelmunster/> 

 <https://www.instagram.com/ingelmunster/> 

 <https://www.pinterest.com/ingelmunster/> 

 <https://twitter.com/ingelmunster> 


 <http://www.ingelmunster.be/email-disclaimer.html> Raadpleeg onze disclaimer 

-Oorspronkelijk bericht-
Van: Nyall Dawson [mailto:nyall.daw...@gmail.com] 
Verzonden: donderdag 9 augustus 2018 8:36
Aan: Reginald Carlier
CC: qgis-user
Onderwerp: Re: [Qgis-user] localisation of date fails in QGIS 3.2

On Mon, 30 Jul 2018 at 19:22, Reginald mailto:reginald.carl...@ingelmunster.be> > wrote:
>
> Hi,
>
> I have a script that was adapted to python 3.6 and runs fine on QGIS 3.2.
> The problem I'm having is that the date shows up in english.
> Under Extra > Options > Algemeen i have:
> Vertaling gebruikers-interface --> Nederlands
> Locale Dutch Belgium (nl_BE)
>
> Also if I choose for "Systeemlocale negeren" (ignore system locale) I still
> get the date in english.
> My code looks like this and works fine in QGIS 2.18:
>
>

I think you forgot to include the code? Can you re-share?

Nyall



smime.p7s
Description: S/MIME cryptographic signature
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Alessandro Pasotti
On Thu, Aug 9, 2018 at 9:23 AM, Reginald Carlier <
reginald.carl...@ingelmunster.be> wrote:

> Thanks a lot Alessandro,
>
>
>
> That works perfectly.
>

Glad it helped.


btw, this is a side-effect of the recent changes in QGIS locale: we are now
using setting a "default locale" (from QGIS settings) when QGIS starts, and
that locale is used through the whole QGIS application.

If you change the default locale in the settings, please remember to
restart QGIS.




>
> Reginald Carlier
> Deskundige GIS
> <https://www.ingelmunster.be/>
> Gemeente Ingelmunster ,  Oostrozebekestraat
> <https://maps.google.com/?q=Oostrozebekestraat+4+,+8770+Ingelmunster=gmail=g>
>  4
> <https://maps.google.com/?q=Oostrozebekestraat+4+,+8770+Ingelmunster=gmail=g>
> ,
> <https://maps.google.com/?q=Oostrozebekestraat+4+,+8770+Ingelmunster=gmail=g>
>   8770
> <https://maps.google.com/?q=Oostrozebekestraat+4+,+8770+Ingelmunster=gmail=g>
>   Ingelmunster
> <https://maps.google.com/?q=Oostrozebekestraat+4+,+8770+Ingelmunster=gmail=g>
> T *+32 51 33 74 39* <+32%2051%2033%2074%2039>
> *www.ingelmunster.be* <http://www.ingelmunster.be/>
> [image: Facebook] <https://www.facebook.com/Ingelmunster/> [image:
> instagram] <https://www.instagram.com/ingelmunster/> [image: pinterest]
> <https://www.pinterest.com/ingelmunster/> [image: twitter]
> <https://twitter.com/ingelmunster>
> *Raadpleeg onze disclaimer *
> <http://www.ingelmunster.be/email-disclaimer.html>
> *Van:* Alessandro Pasotti [mailto:apaso...@gmail.com]
> *Verzonden:* donderdag 9 augustus 2018 9:10
> *Aan:* Reginald Carlier
> *CC:* Nyall Dawson [via OSGeo.org]; qgis-user@lists.osgeo.org
> *Onderwerp:* Re: [Qgis-user] localisation of date fails in QGIS 3.2
>
>
>
> Reginald,
>
>
>
>
>
> Using QT:
>
>
>
> locale = QLocale(QLocale.Japanese)
>
> locale.toString(QDate.currentDate())
>
>
>
> And, if you want to use the same settings that you set in QGIS, just use
> the default locale:
>
>
>
> locale = QLocale() # Default locale from QGIS options/settings
>
> locale.toString(QDate.currentDate())
>
>
>
>
>
>
>
>
>
> On Thu, Aug 9, 2018 at 8:54 AM, Reginald Carlier  ingelmunster.be> wrote:
>
> I forgot to mention that I import datetime as follows:
>
>
>
> from datetime import datetime
>
>
>
> In the console I get the same result as from my script.
>
> Maybe I should use QCoreApplication.translate or some other explicit way
> to tell python to translate a string from English to Dutch?
>
>
>
> Regards,
>
>
>
> Reginald Carlier
>
> Deskundige GIS
>
> *Fout! Bestandsnaam niet opgegeven.* <https://www.ingelmunster.be/>
>
> Gemeente Ingelmunster
>
> ,
>
> Oostrozebekestraat
> <https://maps.google.com/?q=Oostrozebekestraat+4+%0D%0A+%0D%0A+%0D%0A+,+%0D%0A+%0D%0A+%0D%0A+8770+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+Ingelmunster=gmail=g>
>  4
>
> ,
> <https://maps.google.com/?q=Oostrozebekestraat+4+%0D%0A+%0D%0A+%0D%0A+,+%0D%0A+%0D%0A+%0D%0A+8770+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+Ingelmunster=gmail=g>
>
>
> 8770
> <https://maps.google.com/?q=Oostrozebekestraat+4+%0D%0A+%0D%0A+%0D%0A+,+%0D%0A+%0D%0A+%0D%0A+8770+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+Ingelmunster=gmail=g>
>
>
>
> Ingelmunster
> <https://maps.google.com/?q=Oostrozebekestraat+4+%0D%0A+%0D%0A+%0D%0A+,+%0D%0A+%0D%0A+%0D%0A+8770+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+Ingelmunster=gmail=g>
>
> T
>
> *+32 51 33 74 39* <+32%2051%2033%2074%2039>
>
> *www.ingelmunster.be* <http://www.ingelmunster.be/>
>
> *Fout! Bestandsnaam niet opgegeven.*
> <https://www.facebook.com/Ingelmunster/>
>
> *Fout! Bestandsnaam niet opgegeven.*
> <https://www.instagram.com/ingelmunster/>
>
> *Fout! Bestandsnaam niet opgegeven.*
> <https://www.pinterest.com/ingelmunster/>
>
> *Fout! Bestandsnaam niet opgegeven.* <https://twitter.com/ingelmunster>
>
> *Raadpleeg onze disclaimer *
> <http://www.ingelmunster.be/email-disclaimer.html>
>
> *Van:* Nyall Dawson [via OSGeo.org] [mailto:ml+s1560n5373899h69@
> n6.nabble.com]
> *Verzonden:* donderdag 9 augustus 2018 8:4
> <https://maps.google.com/?q=Oostrozebekestraat+4+%0D%0A+%0D%0A+%0D%0A+,+%0D%0A+%0D%0A+%0D%0A+8770+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+%0D%0A+Ingelmunster=gmail=g>
> 3
> *Aan:* Reginald Carlier
> *Onderwerp:* Re: localisation of date fails in QGIS 3.2
>
>
>
> On Thu, 9 Aug 2018 at 16:39, Reginald Carlier
> <[hidden email] <http://user/SendEmail.jtp?type=node=5373899=0>>
> 

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Reginald Carlier
Thanks a lot Alessandro,

That works perfectly.


Reginald Carlier
Deskundige GIS
Gemeente Ingelmunster, Oostrozebekestraat 4, 8770 Ingelmunster
T+32 51 33 74 39www.ingelmunster.be
Raadpleeg onze disclaimer
Van: Alessandro Pasotti [mailto:apaso...@gmail.com]
Verzonden: donderdag 9 augustus 2018 9:10
Aan: Reginald Carlier
CC: Nyall Dawson [via OSGeo.org]; qgis-user@lists.osgeo.org
Onderwerp: Re: [Qgis-user] localisation of date fails in QGIS 3.2


Reginald,





Using QT:



locale = QLocale(QLocale.Japanese)

locale.toString(QDate.currentDate())



And, if you want to use the same settings that you set in QGIS, just use the 
default locale:



locale = QLocale() # Default locale from QGIS options/settings

locale.toString(QDate.currentDate())





On Thu, Aug 9, 2018 at 8:54 AM, Reginald Carlier 
mailto:reginald.carl...@ingelmunster.be>> 
wrote:
I forgot to mention that I import datetime as follows:

from datetime import datetime

In the console I get the same result as from my script.
Maybe I should use QCoreApplication.translate or some other explicit way to 
tell python to translate a string from English to Dutch?

Regards,

Reginald Carlier​


Deskundige GIS




Fout! Bestandsnaam niet opgegeven.<https://www.ingelmunster.be/>


Gemeente Ingelmunster

,

Oostrozebekestraat 4

,

8770



Ingelmunster



T

+32 51 33 74 39

www.ingelmunster.be<http://www.ingelmunster.be/>




Fout! Bestandsnaam niet opgegeven.<https://www.facebook.com/Ingelmunster/>

Fout! Bestandsnaam niet opgegeven.<https://www.instagram.com/ingelmunster/>

Fout! Bestandsnaam niet opgegeven.<https://www.pinterest.com/ingelmunster/>

Fout! Bestandsnaam niet opgegeven.<https://twitter.com/ingelmunster>



Raadpleeg onze disclaimer <http://www.ingelmunster.be/email-disclaimer.html>

Van: Nyall Dawson [via OSGeo.org] 
[mailto:ml+s1560n5373899...@n6.nabble.com<mailto:ml%2bs1560n5373899...@n6.nabble.com>]
Verzonden: donderdag 9 augustus 2018 8:43
Aan: Reginald Carlier
Onderwerp: Re: localisation of date fails in QGIS 3.2

On Thu, 9 Aug 2018 at 16:39, Reginald Carlier
<[hidden email]<http://user/SendEmail.jtp?type=node=5373899=0>> wrote:

>
> Hi Nyall,
>
> Somehow my post shows the code but my previous post doesn't.
> Anyway this is how the code looks:
>
> vandaag = datetime.now()
> dag = vandaag.day
> maand = vandaag.strftime("%B")
> jaar = vandaag.year
> datum = str(dag) + " " + maand + " " + str(jaar)
>
> I suspect that maybe strftime changed in python 3.6?

Do you see the same from a standalone python console? (I'm not sure
that this issue is related to QGIS at all or whether it's a Python
specific thing).

Nyall
___
Qgis-user mailing list
[hidden email]<http://user/SendEmail.jtp?type=node=5373899=1>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/localisation-of-date-fails-in-QGIS-3-2-tp5372703p5373899.html
To start a new topic under QGIS - User, email 
ml+s1560n4125267...@n6.nabble.com<mailto:ml%2bs1560n4125267...@n6.nabble.com>
To unsubscribe from QGIS, click 
here<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=4099105=UmVnaW5hbGQuQ2FybGllckBpbmdlbG11bnN0ZXIuYmV8NDA5OTEwNXw3OTAxNjMzMzQ=>.
NAML<http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org<mailto:Qgis-user@lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



--
Alessandro Pasotti
w3:   www.itopen.it<http://www.itopen.it>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Alessandro Pasotti
Reginald,



Using QT:


locale = QLocale(QLocale.Japanese)

locale.toString(QDate.currentDate())


And, if you want to use the same settings that you set in QGIS, just use
the default locale:


locale = QLocale() # Default locale from QGIS options/settings

locale.toString(QDate.currentDate())





On Thu, Aug 9, 2018 at 8:54 AM, Reginald Carlier <
reginald.carl...@ingelmunster.be> wrote:

> I forgot to mention that I import datetime as follows:
>
>
>
> from datetime import datetime
>
>
>
> In the console I get the same result as from my script.
>
> Maybe I should use QCoreApplication.translate or some other explicit way
> to tell python to translate a string from English to Dutch?
>
>
>
> Regards,
>
>
>
> Reginald Carlier​
> Deskundige GIS
> 
> Gemeente Ingelmunster ,  Oostrozebekestraat 4 ,  8770   Ingelmunster
> T *+32 51 33 74 39* <+32%2051%2033%2074%2039>
> *www.ingelmunster.be* 
> [image: Facebook]  [image:
> instagram]  [image: pinterest]
>  [image: twitter]
> 
> *Raadpleeg onze disclaimer *
> 
> *Van:* Nyall Dawson [via OSGeo.org] [mailto:ml+s1560n5373899h69@
> n6.nabble.com]
> *Verzonden:* donderdag 9 augustus 2018 8:43
> *Aan:* Reginald Carlier
> *Onderwerp:* Re: localisation of date fails in QGIS 3.2
>
>
>
> On Thu, 9 Aug 2018 at 16:39, Reginald Carlier
> <[hidden email] >
> wrote:
>
>
> >
> > Hi Nyall,
> >
> > Somehow my post shows the code but my previous post doesn't.
> > Anyway this is how the code looks:
> >
> > vandaag = datetime.now()
> > dag = vandaag.day
> > maand = vandaag.strftime("%B")
> > jaar = vandaag.year
> > datum = str(dag) + " " + maand + " " + str(jaar)
> >
> > I suspect that maybe strftime changed in python 3.6?
>
>
> Do you see the same from a standalone python console? (I'm not sure
> that this issue is related to QGIS at all or whether it's a Python
> specific thing).
>
> Nyall
> ___
> Qgis-user mailing list
> [hidden email] 
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> --
>
> *If you reply to this email, your message will be added to the discussion
> below:*
>
> http://osgeo-org.1560.x6.nabble.com/localisation-of-
> date-fails-in-QGIS-3-2-tp5372703p5373899.html
>
> To start a new topic under QGIS - User, email
> ml+s1560n4125267...@n6.nabble.com
> To unsubscribe from QGIS, click here
> 
> .
> NAML
> 
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>



-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Reginald Carlier
I forgot to mention that I import datetime as follows:

from datetime import datetime

In the console I get the same result as from my script.
Maybe I should use QCoreApplication.translate or some other explicit way to 
tell python to translate a string from English to Dutch?

Regards,


Reginald Carlier
Deskundige GIS
Gemeente Ingelmunster, Oostrozebekestraat 4, 8770 Ingelmunster
T+32 51 33 74 39www.ingelmunster.be
Raadpleeg onze disclaimer
Van: Nyall Dawson [via OSGeo.org] [mailto:ml+s1560n5373899...@n6.nabble.com]
Verzonden: donderdag 9 augustus 2018 8:43
Aan: Reginald Carlier
Onderwerp: Re: localisation of date fails in QGIS 3.2

On Thu, 9 Aug 2018 at 16:39, Reginald Carlier
<[hidden email]> wrote:

>
> Hi Nyall,
>
> Somehow my post shows the code but my previous post doesn't.
> Anyway this is how the code looks:
>
> vandaag = datetime.now()
> dag = vandaag.day
> maand = vandaag.strftime("%B")
> jaar = vandaag.year
> datum = str(dag) + " " + maand + " " + str(jaar)
>
> I suspect that maybe strftime changed in python 3.6?

Do you see the same from a standalone python console? (I'm not sure
that this issue is related to QGIS at all or whether it's a Python
specific thing).

Nyall
___
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/localisation-of-date-fails-in-QGIS-3-2-tp5372703p5373899.html
To start a new topic under QGIS - User, email ml+s1560n4125267...@n6.nabble.com
To unsubscribe from QGIS, click 
here.
NAML
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Nyall Dawson
On Thu, 9 Aug 2018 at 16:39, Reginald Carlier
 wrote:
>
> Hi Nyall,
>
> Somehow my post shows the code but my previous post doesn't.
> Anyway this is how the code looks:
>
> vandaag = datetime.now()
> dag = vandaag.day
> maand = vandaag.strftime("%B")
> jaar = vandaag.year
> datum = str(dag) + " " + maand + " " + str(jaar)
>
> I suspect that maybe strftime changed in python 3.6?

Do you see the same from a standalone python console? (I'm not sure
that this issue is related to QGIS at all or whether it's a Python
specific thing).

Nyall
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Reginald Carlier
Hi Nyall,

Somehow my post shows the code but my previous post doesn't.
Anyway this is how the code looks:

vandaag = datetime.now()
dag = vandaag.day
maand = vandaag.strftime("%B")
jaar = vandaag.year
datum = str(dag) + " " +  maand + " " + str(jaar)

I suspect that maybe strftime changed in python 3.6?

Regards,


Reginald Carlier
Deskundige GIS
Gemeente Ingelmunster, Oostrozebekestraat 4, 8770 Ingelmunster
T+32 51 33 74 39www.ingelmunster.be
Raadpleeg onze disclaimer
-Oorspronkelijk bericht-
Van: Nyall Dawson [mailto:nyall.daw...@gmail.com]
Verzonden: donderdag 9 augustus 2018 8:36
Aan: Reginald Carlier
CC: qgis-user
Onderwerp: Re: [Qgis-user] localisation of date fails in QGIS 3.2

On Mon, 30 Jul 2018 at 19:22, Reginald  wrote:
>
> Hi,
>
> I have a script that was adapted to python 3.6 and runs fine on QGIS 3.2.
> The problem I'm having is that the date shows up in english.
> Under Extra > Options > Algemeen i have:
> Vertaling gebruikers-interface --> Nederlands
> Locale Dutch Belgium (nl_BE)
>
> Also if I choose for "Systeemlocale negeren" (ignore system locale) I still
> get the date in english.
> My code looks like this and works fine in QGIS 2.18:
>
>

I think you forgot to include the code? Can you re-share?

Nyall
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Nyall Dawson
On Mon, 30 Jul 2018 at 19:22, Reginald  wrote:
>
> Hi,
>
> I have a script that was adapted to python 3.6 and runs fine on QGIS 3.2.
> The problem I'm having is that the date shows up in english.
> Under Extra > Options > Algemeen i have:
> Vertaling gebruikers-interface --> Nederlands
> Locale Dutch Belgium (nl_BE)
>
> Also if I choose for "Systeemlocale negeren" (ignore system locale) I still
> get the date in english.
> My code looks like this and works fine in QGIS 2.18:
>
>

I think you forgot to include the code? Can you re-share?

Nyall
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Andreas Neumann
Hi Reginald, 

Perhaps ask the same question in the qgis-developer mailing list? You
are more likely to get an answer. 

There have been quite some changes (with some side effects) on
localization introduced in QGIS 3.2. Maybe this issue is related? 

Andreas 

On 2018-08-09 08:14, Reginald wrote:

> nobody has issues with localisation in QGIS 3.2?
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] localisation of date fails in QGIS 3.2

2018-08-09 Thread Reginald
nobody has issues with localisation in QGIS 3.2?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user