mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:35:49 +00:00
- make more util mui-aware
- english translation needs to be done svn path=/trunk/; revision=28502
This commit is contained in:
parent
f7da3af16d
commit
cffe612011
6 changed files with 115 additions and 17 deletions
35
reactos/base/applications/cmdutils/more/lang/de-DE.rc
Normal file
35
reactos/base/applications/cmdutils/more/lang/de-DE.rc
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
{
|
||||||
|
IDS_USAGE, "Zeigt Daten seitenweise auf dem Bildschirm an.\n\n\
|
||||||
|
MORE [/E [/C] [/P] [/S] [/Tn] [+n]] < [Laufwerk:][Pfad]Dateiname\n\
|
||||||
|
Befehl | MORE [/E [/C] [/P] [/S] [/Tn] [+n]] \n\
|
||||||
|
MORE /E [/C] [/P] [/S] [/Tn] [+n] [Dateien]\n\n\
|
||||||
|
[Laufwerk:][Pfad]Dateiname Ein Datei, deren Inhalt angezeigt\n\
|
||||||
|
\t\t\t werden soll.\n\n\
|
||||||
|
Befehl\t\t Ein Befehl, dessen Ausgabe angezeigt\n\
|
||||||
|
\t\t\t werden soll.\n\n\
|
||||||
|
/E\tAktiviert die erweiterten Möglichkeiten.\n\
|
||||||
|
/C\tLöscht den Bildschirm, bevor eine Seite angezeigt wird.\n\
|
||||||
|
/P\tFührt Seitenvorschubzeichen aus.\n\
|
||||||
|
/S\tFasst mehrere leere Zeilen zu einer Zeile zusammen.\n\
|
||||||
|
/Tn\tErsetzt Tabulatorenzeichen durch n Leerzeichen (Standard 8).\n\n\
|
||||||
|
\tDie Optionen können in der Umgebungsvariablen MORE angegeben\n\
|
||||||
|
\twerden.\n\n\
|
||||||
|
+n\tBeginnt mit der Anzeige der ersten Datei in Zeile n.\n\n\
|
||||||
|
Dateien Gibt eine Liste mit anzuzeigenden Dateien an.\n\
|
||||||
|
\t Trennen sie die Dateinamen durch ein Leerzeichen.\n\n\
|
||||||
|
Wenn die erweiterten Möglichkeiten aktiviert sind, können die folgenden\n\
|
||||||
|
Befehle an der Eingabeforderung \"--Fortsetzung--\" eingegeben werden:\n\n\
|
||||||
|
P n\t Zeigt die nächsten n Zeilen an.\n\
|
||||||
|
S n\t Überspringt die nächsten n Zeilen.\n\
|
||||||
|
Q\tBeendet die Ausgabe.\n\
|
||||||
|
=\tZeigt die Zeilennummer an.\n\
|
||||||
|
?\tZeigt die Hilfezeile an.\n\
|
||||||
|
<LEERTASTE> Zeigt die nächste Zeile an.\n\
|
||||||
|
<EINGABETASTE> Zeigt die nächste Zeile an.\n"
|
||||||
|
|
||||||
|
IDS_CONTINUE, " -- Fortsetzung (100%) -- "
|
||||||
|
IDS_FILE_ACCESS, "Auf die Datei %s kann nicht zugegriffen werden."
|
||||||
|
}
|
|
@ -13,11 +13,12 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
static TCHAR szCont[128];
|
||||||
DWORD len;
|
static DWORD szContLength;
|
||||||
LPTSTR msg = _T("--- continue ---");
|
static HINSTANCE hApp;
|
||||||
|
|
||||||
|
|
||||||
/*handle for file and console*/
|
/*handle for file and console*/
|
||||||
HANDLE hStdIn;
|
HANDLE hStdIn;
|
||||||
|
@ -42,7 +43,7 @@ static
|
||||||
VOID ConOutPuts (LPTSTR szText)
|
VOID ConOutPuts (LPTSTR szText)
|
||||||
{
|
{
|
||||||
DWORD dwWritten;
|
DWORD dwWritten;
|
||||||
|
|
||||||
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
|
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten, NULL);
|
||||||
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
|
WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +71,7 @@ WaitForKey (VOID)
|
||||||
{
|
{
|
||||||
DWORD dwWritten;
|
DWORD dwWritten;
|
||||||
|
|
||||||
WriteFile (hStdErr,msg , len, &dwWritten, NULL);
|
WriteFile (hStdErr, szCont , szContLength, &dwWritten, NULL);
|
||||||
|
|
||||||
ConInKey();
|
ConInKey();
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ int main (int argc, char **argv)
|
||||||
DWORD i, last;
|
DWORD i, last;
|
||||||
HANDLE hFile = INVALID_HANDLE_VALUE;
|
HANDLE hFile = INVALID_HANDLE_VALUE;
|
||||||
TCHAR szFullPath[MAX_PATH];
|
TCHAR szFullPath[MAX_PATH];
|
||||||
|
TCHAR szMsg[1024];
|
||||||
/*reading/writing buffer*/
|
/*reading/writing buffer*/
|
||||||
TCHAR *buff;
|
TCHAR *buff;
|
||||||
|
|
||||||
|
@ -98,14 +99,28 @@ int main (int argc, char **argv)
|
||||||
/*ReadFile() return value*/
|
/*ReadFile() return value*/
|
||||||
BOOL bRet;
|
BOOL bRet;
|
||||||
|
|
||||||
len = _tcslen (msg);
|
|
||||||
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
|
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
hStdErr = GetStdHandle(STD_ERROR_HANDLE);
|
hStdErr = GetStdHandle(STD_ERROR_HANDLE);
|
||||||
|
hApp = GetModuleHandle(NULL);
|
||||||
|
|
||||||
|
buff=malloc(4096);
|
||||||
|
if (!buff)
|
||||||
|
{
|
||||||
|
ConOutPuts(_T("Error: no memory"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (argc > 1 && _tcsncmp (argv[1], _T("/?"), 2) == 0)
|
if (argc > 1 && _tcsncmp (argv[1], _T("/?"), 2) == 0)
|
||||||
{
|
{
|
||||||
ConOutPuts(_T("Help text still missing!!"));
|
if (LoadString(hApp, IDS_USAGE, buff, 4096 / sizeof(TCHAR)) < 4096 / sizeof(TCHAR))
|
||||||
|
{
|
||||||
|
CharToOem(buff, buff);
|
||||||
|
ConOutPuts(buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buff);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,20 +129,31 @@ int main (int argc, char **argv)
|
||||||
|
|
||||||
GetScreenSize(&maxx,&maxy);
|
GetScreenSize(&maxx,&maxy);
|
||||||
|
|
||||||
buff=malloc(4096);
|
|
||||||
|
|
||||||
FlushConsoleInputBuffer (hKeyboard);
|
FlushConsoleInputBuffer (hKeyboard);
|
||||||
|
|
||||||
if(argc > 1)
|
if(argc > 1)
|
||||||
{
|
{
|
||||||
GetFullPathName(argv[1], MAX_PATH, szFullPath, NULL);
|
GetFullPathNameA(argv[1], MAX_PATH, szFullPath, NULL);
|
||||||
hFile = CreateFile (szFullPath, GENERIC_READ,
|
hFile = CreateFile (szFullPath,
|
||||||
0,NULL,OPEN_ALWAYS,0,0);
|
GENERIC_READ,
|
||||||
|
0,
|
||||||
if (hFile == INVALID_HANDLE_VALUE)
|
NULL,
|
||||||
|
OPEN_EXISTING,
|
||||||
|
0,
|
||||||
|
0);
|
||||||
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
ConOutPuts(_T("The file could not be opened"));
|
if (LoadString(hApp, IDS_FILE_ACCESS, szMsg, sizeof(szMsg) / sizeof(TCHAR)) < sizeof(szMsg) / sizeof(TCHAR))
|
||||||
return 0;
|
{
|
||||||
|
_stprintf(buff, szMsg, szFullPath);
|
||||||
|
CharToOem(buff, buff);
|
||||||
|
ConOutPuts(buff);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(buff);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -135,6 +161,15 @@ int main (int argc, char **argv)
|
||||||
hFile = hStdIn;
|
hFile = hStdIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!LoadString(hApp, IDS_CONTINUE, szCont, sizeof(szCont) / sizeof(TCHAR)))
|
||||||
|
{
|
||||||
|
/* fail back to english */
|
||||||
|
_tcscpy(szCont, _T("--- continue ---"));
|
||||||
|
}
|
||||||
|
szContLength = _tcslen(szCont);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
bRet = ReadFile(hFile,buff,4096,&dwRead,NULL);
|
bRet = ReadFile(hFile,buff,4096,&dwRead,NULL);
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<define name="_WIN32_WINNT">0x0501</define>
|
<define name="_WIN32_WINNT">0x0501</define>
|
||||||
<library>kernel32</library>
|
<library>kernel32</library>
|
||||||
<library>ntdll</library>
|
<library>ntdll</library>
|
||||||
|
<library>user32</library>
|
||||||
<file>more.c</file>
|
<file>more.c</file>
|
||||||
<file>more.rc</file>
|
<file>more.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -4,3 +4,5 @@
|
||||||
#define REACTOS_STR_INTERNAL_NAME "more\0"
|
#define REACTOS_STR_INTERNAL_NAME "more\0"
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "more.exe\0"
|
#define REACTOS_STR_ORIGINAL_FILENAME "more.exe\0"
|
||||||
#include <reactos/version.rc>
|
#include <reactos/version.rc>
|
||||||
|
|
||||||
|
#include "rsrc.rc"
|
||||||
|
|
20
reactos/base/applications/cmdutils/more/resource.h
Normal file
20
reactos/base/applications/cmdutils/more/resource.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#ifndef RESOURCE_H__ /* resource.h */
|
||||||
|
#define RESOURCE_H__
|
||||||
|
|
||||||
|
#define IDS_USAGE 100
|
||||||
|
#define IDS_CONTINUE 101
|
||||||
|
#define IDS_FILE_ACCESS 102
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* EOF of resource.h */
|
5
reactos/base/applications/cmdutils/more/rsrc.rc
Normal file
5
reactos/base/applications/cmdutils/more/rsrc.rc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
#include "lang/de-DE.rc"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue