Find out OS language via datestr command?
이전 댓글 표시
Hi folks,
i wonder if the datestr command can help finding out the operating system's basic language.
I can only test the German and English version at my system via:
datestr('05/01/2000','mmmm','local')
If the result is "may", it is English. If it is "mai", it is German.
I wonder if this also works in Spanish and Swedish home countries e.g.. Who can help me find out? What local settings are respected inside the datestr command?
To be more precise: I want information about the language, which is used to display the Windows 7 startmenu-ribbon with "documents", "images", "music", "computer", "system", ... or (German): "Dokumente", "Bilder", "Musik", ...
Regards, Johannes
댓글 수: 2
Andreas Goser
2013년 6월 5일
I am interested about the background of this request. In particular if this is related to Volkswagen locations in countries in Asia, there may be value to get in touch with MathWorks.
Johannes Korsawe
2013년 6월 5일
채택된 답변
추가 답변 (2개)
Friedrich
2013년 6월 5일
HI,
what about:
>> java.lang.System.getProperty('user.language')
ans =
de
>> java.lang.System.getProperty('user.country')
ans =
DE
Not sure which one is needed exactly here. Could someone with an non German OS try that?
댓글 수: 2
Johannes Korsawe
2013년 6월 5일
Sorry havent seen that.
But overall that wont work because it depends on the System's Regional Settings. Just the location setting of your system wont help. When your regional setting is DE but your language is set to english you will get DE as answer from JAVA but you actually have an english language OS.
See also here:
The ONLY reliable thing on WIndows is:
>>System.Globalization.CultureInfo.CurrentUICulture.ThreeLetterWindowsLanguageName
Daniel Shub
2013년 6월 4일
편집: Daniel Shub
2013년 6월 4일
You probably can, but it seems really silly to try. On Linux you can do
! echo $LANG
For Windows, I don't know an easy one line answer, but you could parse
! wmic os get locale
or
! wmic os get oslanguage
댓글 수: 5
Johannes Korsawe
2013년 6월 4일
Daniel Shub
2013년 6월 4일
I edited the answer to use wmic instead of systeminfo.
Walter Roberson
2013년 6월 4일
In MATLAB,
getenv('LANG')
I do not know if that works in MS Windows
Daniel Shub
2013년 6월 4일
@Walter I believe it would work if MS Windows set a LANG variable, but in general it doesn't ...
Johannes Korsawe
2013년 6월 5일
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!