Author: cfinck
Date: Tue Aug 28 19:54:19 2007
New Revision: 28620
URL:
http://svn.reactos.org/svn/reactos?rev=28620&view=rev
Log:
- Remove most of the Usage text from the german translation. It was just copied from the
Windows "more" utility and our tool does not support any of the extended options
yet.
I changed the text, so it only includes the features we currently support.
- Change SUBLANG_DEFAULT to SUBLANG_NEUTRAL in the german translation
- Add an English (US) translation
- Use a consistent indentation in "more.c"
- Exit the tool if reading IDS_CONTINUE fails instead of falling back to a hardcoded
string
Added:
trunk/reactos/base/applications/cmdutils/more/lang/en-US.rc
Modified:
trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc
trunk/reactos/base/applications/cmdutils/more/more.c
trunk/reactos/base/applications/cmdutils/more/rsrc.rc
Modified: trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc (original)
+++ trunk/reactos/base/applications/cmdutils/more/lang/de-DE.rc Tue Aug 28 19:54:19 2007
@@ -1,34 +1,15 @@
-LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
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"
+ MORE < [Laufwerk:][Pfad]Dateiname\n\
+ Befehl | MORE \n\
+ MORE [Laufwerk:][Pfad]Dateiname\n\n\
+ [Laufwerk:][Pfad]Dateiname Eine Datei, deren Inhalt angezeigt werden soll.\n\
+ Befehl\t\t Ein Befehl, dessen Ausgabe angezeigt werden soll.\n\n\
+ An der Eingabeaufforderung ""-- Fortsetzung --"" kann eine
beliebige\n\
+ Taste gedrückt werden, um die nächste Seite anzuzeigen.\n"
IDS_CONTINUE, " -- Fortsetzung (100%) -- "
IDS_FILE_ACCESS, "Auf die Datei %s kann nicht zugegriffen werden."
Added: trunk/reactos/base/applications/cmdutils/more/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/lang/en-US.rc (added)
+++ trunk/reactos/base/applications/cmdutils/more/lang/en-US.rc Tue Aug 28 19:54:19 2007
@@ -1,0 +1,15 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_USAGE, "Displays data page-by-page on the screen.\n\n\
+ MORE < [Drive:][Path]File name\n\
+ Command | MORE \n\
+ MORE [Drive:][Path]File name\n\n\
+ [Drive:][Path]File name A file, whose content shall be displayed.\n\
+ Command\t\t A command, whose output shall be displayed.\n\n\
+ At the prompt ""-- Continue --"" you can press any key to show the
next page.\n"
+
+ IDS_CONTINUE, " -- Continue (100%) -- "
+ IDS_FILE_ACCESS, "Cannot access the file %s."
+}
Modified: trunk/reactos/base/applications/cmdutils/more/more.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/more.c (original)
+++ trunk/reactos/base/applications/cmdutils/more/more.c Tue Aug 28 19:54:19 2007
@@ -30,11 +30,11 @@
static VOID
GetScreenSize (PSHORT maxx, PSHORT maxy)
{
- CONSOLE_SCREEN_BUFFER_INFO csbi;
-
- GetConsoleScreenBufferInfo (hStdOut, &csbi);
- *maxx = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
- *maxy = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4;
+ CONSOLE_SCREEN_BUFFER_INFO csbi;
+
+ GetConsoleScreenBufferInfo (hStdOut, &csbi);
+ *maxx = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
+ *maxy = (csbi.srWindow.Bottom - csbi.srWindow.Top) - 4;
}
@@ -42,40 +42,40 @@
static
VOID ConOutPuts (LPTSTR szText)
{
- DWORD dwWritten;
-
- WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten,
NULL);
- WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten, NULL);
+ DWORD dwWritten;
+
+ WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), szText, _tcslen(szText), &dwWritten,
NULL);
+ WriteFile (GetStdHandle (STD_OUTPUT_HANDLE), "\n", 1, &dwWritten,
NULL);
}
static VOID
ConInKey (VOID)
{
- INPUT_RECORD ir;
- DWORD dwRead;
-
- do
- {
- ReadConsoleInput (hKeyboard, &ir, 1, &dwRead);
- if ((ir.EventType == KEY_EVENT) &&
- (ir.Event.KeyEvent.bKeyDown == TRUE))
- return;
- }
- while (TRUE);
+ INPUT_RECORD ir;
+ DWORD dwRead;
+
+ do
+ {
+ ReadConsoleInput (hKeyboard, &ir, 1, &dwRead);
+ if ((ir.EventType == KEY_EVENT) &&
+ (ir.Event.KeyEvent.bKeyDown == TRUE))
+ return;
+ }
+ while (TRUE);
}
static VOID
WaitForKey (VOID)
{
- DWORD dwWritten;
+ DWORD dwWritten;
WriteFile (hStdErr, szCont , szContLength, &dwWritten, NULL);
- ConInKey();
-
- WriteFile (hStdErr, _T("\n"), 1, &dwWritten, NULL);
+ ConInKey();
+
+ WriteFile (hStdErr, _T("\n"), 1, &dwWritten, NULL);
// FlushConsoleInputBuffer (hConsoleIn);
}
@@ -84,125 +84,125 @@
//INT CommandMore (LPTSTR cmd, LPTSTR param)
int main (int argc, char **argv)
{
- SHORT maxx,maxy;
- SHORT line_count=0,ch_count=0;
- DWORD i, last;
- HANDLE hFile = INVALID_HANDLE_VALUE;
- TCHAR szFullPath[MAX_PATH];
+ SHORT maxx,maxy;
+ SHORT line_count=0,ch_count=0;
+ DWORD i, last;
+ HANDLE hFile = INVALID_HANDLE_VALUE;
+ TCHAR szFullPath[MAX_PATH];
TCHAR szMsg[1024];
- /*reading/writing buffer*/
- TCHAR *buff;
-
- /*bytes written by WriteFile and ReadFile*/
- DWORD dwRead,dwWritten;
-
- /*ReadFile() return value*/
- BOOL bRet;
-
-
- hStdIn = GetStdHandle(STD_INPUT_HANDLE);
- hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- hStdErr = GetStdHandle(STD_ERROR_HANDLE);
+ /*reading/writing buffer*/
+ TCHAR *buff;
+
+ /*bytes written by WriteFile and ReadFile*/
+ DWORD dwRead,dwWritten;
+
+ /*ReadFile() return value*/
+ BOOL bRet;
+
+
+ hStdIn = GetStdHandle(STD_INPUT_HANDLE);
+ hStdOut = GetStdHandle(STD_OUTPUT_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 (LoadString(hApp, IDS_USAGE, buff, 4096 / sizeof(TCHAR)) < 4096 /
sizeof(TCHAR))
- {
- CharToOem(buff, buff);
- ConOutPuts(buff);
- }
-
- free(buff);
- return 0;
- }
-
- hKeyboard = CreateFile (_T("CONIN$"), GENERIC_READ,
- 0,NULL,OPEN_ALWAYS,0,0);
-
- GetScreenSize(&maxx,&maxy);
-
-
-
- FlushConsoleInputBuffer (hKeyboard);
-
- if(argc > 1)
- {
- GetFullPathNameA(argv[1], MAX_PATH, szFullPath, NULL);
- hFile = CreateFile (szFullPath,
+ buff=malloc(4096);
+ if (!buff)
+ {
+ ConOutPuts(_T("Error: no memory"));
+ return 1;
+ }
+
+ if (argc > 1 && _tcsncmp (argv[1], _T("/?"), 2) == 0)
+ {
+ if (LoadString(hApp, IDS_USAGE, buff, 4096 / sizeof(TCHAR)) < 4096 /
sizeof(TCHAR))
+ {
+ CharToOem(buff, buff);
+ ConOutPuts(buff);
+ }
+
+ free(buff);
+ return 0;
+ }
+
+ hKeyboard = CreateFile (_T("CONIN$"), GENERIC_READ,
+ 0,NULL,OPEN_ALWAYS,0,0);
+
+ GetScreenSize(&maxx,&maxy);
+
+
+
+ FlushConsoleInputBuffer (hKeyboard);
+
+ if(argc > 1)
+ {
+ GetFullPathNameA(argv[1], MAX_PATH, szFullPath, NULL);
+ hFile = CreateFile (szFullPath,
GENERIC_READ,
- 0,
+ 0,
NULL,
OPEN_EXISTING,
0,
0);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- if (LoadString(hApp, IDS_FILE_ACCESS, szMsg, sizeof(szMsg) / sizeof(TCHAR))
< sizeof(szMsg) / sizeof(TCHAR))
- {
- _stprintf(buff, szMsg, szFullPath);
- CharToOem(buff, buff);
- ConOutPuts(buff);
- }
-
- free(buff);
- return 0;
- }
- }
- else
- {
- hFile = hStdIn;
- }
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if (LoadString(hApp, IDS_FILE_ACCESS, szMsg, sizeof(szMsg) / sizeof(TCHAR)) <
sizeof(szMsg) / sizeof(TCHAR))
+ {
+ _stprintf(buff, szMsg, szFullPath);
+ CharToOem(buff, buff);
+ ConOutPuts(buff);
+ }
+
+ free(buff);
+ return 0;
+ }
+ }
+ else
+ {
+ hFile = hStdIn;
+ }
if (!LoadString(hApp, IDS_CONTINUE, szCont, sizeof(szCont) / sizeof(TCHAR)))
{
- /* fail back to english */
- _tcscpy(szCont, _T("--- continue ---"));
+ /* Shouldn't happen, so exit */
+ return 1;
}
szContLength = _tcslen(szCont);
- do
- {
- bRet = ReadFile(hFile,buff,4096,&dwRead,NULL);
-
- for(last=i=0;i<dwRead && bRet;i++)
- {
- ch_count++;
- if(buff[i] == _T('\n') || ch_count == maxx)
- {
- ch_count=0;
- line_count++;
- if (line_count == maxy)
- {
- line_count = 0;
- WriteFile(hStdOut,&buff[last], i-last+1, &dwWritten, NULL);
- last=i+1;
- FlushFileBuffers (hStdOut);
- WaitForKey ();
- }
- }
- }
- if (last<dwRead && bRet)
- WriteFile(hStdOut,&buff[last], dwRead-last, &dwWritten, NULL);
-
- }
- while(dwRead>0 && bRet);
-
- free (buff);
- CloseHandle (hKeyboard);
- if (hFile != hStdIn)
- CloseHandle (hFile);
-
- return 0;
+ do
+ {
+ bRet = ReadFile(hFile,buff,4096,&dwRead,NULL);
+
+ for(last=i=0;i<dwRead && bRet;i++)
+ {
+ ch_count++;
+ if(buff[i] == _T('\n') || ch_count == maxx)
+ {
+ ch_count=0;
+ line_count++;
+ if (line_count == maxy)
+ {
+ line_count = 0;
+ WriteFile(hStdOut,&buff[last], i-last+1, &dwWritten, NULL);
+ last=i+1;
+ FlushFileBuffers (hStdOut);
+ WaitForKey ();
+ }
+ }
+ }
+ if (last<dwRead && bRet)
+ WriteFile(hStdOut,&buff[last], dwRead-last, &dwWritten, NULL);
+
+ }
+ while(dwRead>0 && bRet);
+
+ free (buff);
+ CloseHandle (hKeyboard);
+ if (hFile != hStdIn)
+ CloseHandle (hFile);
+
+ return 0;
}
/* EOF */
Modified: trunk/reactos/base/applications/cmdutils/more/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
==============================================================================
--- trunk/reactos/base/applications/cmdutils/more/rsrc.rc (original)
+++ trunk/reactos/base/applications/cmdutils/more/rsrc.rc Tue Aug 28 19:54:19 2007
@@ -1,5 +1,5 @@
#include <windows.h>
#include "resource.h"
-#include "lang/de-DE.rc"
-
+//#include "lang/de-DE.rc"
+#include "lang/en-US.rc"