Command messages/prompts in various languages

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Command messages/prompts in various languages

#1 Post by dbenham » 26 Dec 2014 13:45

Does anyone know of a resource that lists standard command prompts and messages for various languages :?:

For example, XCOPY can produce:

Code: Select all

Does xxxx specify a file name
or directory name on the target
(F = file, D = directory)?

I'd like to see what the prompt looks like in other languages.

Sometimes I would like to write code to derive the correct responses for a prompt in an agnostic way, and having a list of messages in different languages would help determine if there are patterns I can rely on to help parse the needed values.


Dave Benham

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Command messages/prompts in various languages

#2 Post by aGerman » 26 Dec 2014 15:07

Dave

Unfortunately I don't know if such a list exists. I was already looking for someting like that as well.

Code: Select all

Ist das Ziel xxxx ein Dateiname
oder ein Verzeichnisname
(D = Datei, V = Verzeichnis)?

... is what I get back for your XCOPY example. So you could parse the bracket term and assume the first pair is for "file" and the second pair for "directory".
Probably you have to execute an example using the ctrl+c technique beforehand.

Regards
aGerman

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Command messages/prompts in various languages

#3 Post by dbenham » 26 Dec 2014 17:46

Thanks aGerman. I already knew the German letters, but it is good to see that the message is formatted the same.

No Ctrl-C is needed. You can simply redirect input to NUL to capture the output without fear of actually copying anything. It successfully fails after two iterations. (What do you think of that oxymoron :?: :!: )

Code: Select all

<nul xcopy sourceFile destFIle


Dave Benham

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Command messages/prompts in various languages

#4 Post by aGerman » 26 Dec 2014 18:59

What do you think of that oxymoron :?: :!:

If something "successfully fails" it's no oxymoron from my point of view :lol: But "after two iterations" is somewhat stange.

I often use parentheses, brackets, or colons etc. as patterns for searching the right line or as separators.

Code: Select all

C:\>chcp
Aktive Codepage: 850.

C:\>for /f "tokens=2 delims=:" %i in ('chcp') do set /a "oemcp=%~ni"

C:\>set /a "oemcp= 850"
850
C:\>
C:\>ver

Microsoft Windows [Version 6.1.7601]

C:\>for /f "tokens=2 delims=[]" %i in ('ver') do @for /f "tokens=2" %j in ("%i") do @echo %j
6.1.7601

C:\>

I assume that these loops would output the right values for you as well.

Regards
aGerman

Liviu
Expert
Posts: 470
Joined: 13 Jan 2012 21:24

Re: Command messages/prompts in various languages

#5 Post by Liviu » 26 Dec 2014 20:00

dbenham wrote:Does anyone know of a resource that lists standard command prompts and messages for various languages :?:

Don't know that such a list exists (not to mention that some texts have changed between versions). And I think it would be a mighty brave endeavor to compile one, but if anyone volunteers ;-) then the strings themselves are all in *.mui files under %systemRoot%\system32\<language-code> (since Vista), for example system32\en-us\cmd.exe.mui, help.exe.mui etc. They can be viewed with sysinternals' strings.exe (or extracted with a binary resource editor). One could conceivably install additional language packs and examine strings in other languages. or ask faraway friends to collect the strings.exe output in different languages. But I am not aware of a way to do this in any automated/easy fashion.

Liviu

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Command messages/prompts in various languages

#6 Post by aGerman » 27 Dec 2014 06:14

Yes I also thought about MUI files but I wasn't able to find any reference about their structure. They are PE files (like exe or dll) but I don't know how to find the entry points and how they are linked to the related executable. Thus, you could read all the plain text strings but you won't find out where they belong to or in what order they would be displayed. Furthermore there still seem to be other techniques to make executable files multilingual. I wasn't able to find the related mui file for xcopy.exe for example...

Regards
aGerman

Liviu
Expert
Posts: 470
Joined: 13 Jan 2012 21:24

Re: Command messages/prompts in various languages

#7 Post by Liviu » 27 Dec 2014 13:19

The MUI extension and the <language-code> subdirectories (like 'en-us') are a convention introduced in Vista (see for example http://msdn.microsoft.com/en-us/goglobal/cc442492.aspx#MUI), with some support built into Windows (GetFileMUIPath and other APIs). However, the technique itself of isolating the "localized" strings into separate per-language resource-only DLLs has been used forever.

One can match strings between languages based on their numeric resource ID. For an example, looking into the en-US\ULIB.DLL.MUI message table (which holds the strings for a number of file utilities including XCOPY) using http://www.angusj.com/resourcehacker/

Code: Select all

C:\etc>reshacker.exe -extract %systemRoot%\system32\en-us\ulib.dll.mui, ulib.rc, messagetable,,
the generated ulib.rc file contains a line:

Code: Select all

22063,     "Does %1 specify a file name\nor directory name on the target\n(F = file, D = directory)? %0"
The corresponding line with ID 22063 in the German de-DE\ULIB.DLL.MUI would contain the equivalent German string.

Liviu

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Command messages/prompts in various languages

#8 Post by aGerman » 27 Dec 2014 14:08

Great :!: That way one could create the table that Dave was talking about.

Regards
aGerman

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Command messages/prompts in various languages

#9 Post by dbenham » 27 Dec 2014 14:27

Yes :!:

Thanks Liviu - that is great info :D


Dave Benham

Post Reply