December 20, 2011

Jupiter Jupiter
Lab Rat
78 posts

QLocale::system()

 

hi,

i have following code:

  1. QString languageName = systemLocale.name().left(2);

when i run it on windows, it returns my os language (“de”).
when i run it on mac OS lion, it returns “c”. is this a bug?

thanks

1 reply

December 20, 2011

Tobias Hunger Tobias Hunger
Hobby Entomologist
3373 posts

No, C is a valid locale. Basically it is “use no translation at all”.

Check the environment you are running your application in for the LC_* and LANG variables. Maybe something is forcing them to C. We do that in Qt Creator sometimes when we need to make sure to get parse-able output from the applications we run (e.g. the compiler).

 
  ‹‹ GraphicsView: Merging of update regions and optimization implications      how to get the first letter of the string? ››

You must log in to post a reply. Not a member yet? Register here!