[ros-diffs] [mkupfer] 34145: - initial version of i18n of *.inf-files by consideration of [Strings.LanguageId]-sections - sample data for german language [Strings.0407] for hardware description - not working yet!

mkupfer at svn.reactos.org mkupfer at svn.reactos.org
Sat Jun 28 09:56:51 CEST 2008


Author: mkupfer
Date: Sat Jun 28 02:56:51 2008
New Revision: 34145

URL: http://svn.reactos.org/svn/reactos?rev=34145&view=rev
Log:
- initial version of i18n of *.inf-files by consideration of [Strings.LanguageId]-sections
- sample data for german language [Strings.0407] for hardware description
- not working yet!

Modified:
    branches/matthias-i18n/dll/win32/setupapi/parser.c
    branches/matthias-i18n/media/inf/display.inf
    branches/matthias-i18n/media/inf/fdc.inf
    branches/matthias-i18n/media/inf/hdc.inf
    branches/matthias-i18n/media/inf/machine.inf

Modified: branches/matthias-i18n/dll/win32/setupapi/parser.c
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/dll/win32/setupapi/parser.c?rev=34145&r1=34144&r2=34145&view=diff
==============================================================================
--- branches/matthias-i18n/dll/win32/setupapi/parser.c [iso-8859-1] (original)
+++ branches/matthias-i18n/dll/win32/setupapi/parser.c [iso-8859-1] Sat Jun 28 02:56:51 2008
@@ -2,7 +2,7 @@
  * INF file parsing
  *
  * Copyright 2002 Alexandre Julliard for CodeWeavers
- *           2005-2006 Hervé Poussineau (hpoussin at reactos.org)
+ *           2005-2006 Herv� Poussineau (hpoussin at reactos.org)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -140,6 +140,7 @@
 static const WCHAR WindowsNT[]  = {'$','W','i','n','d','o','w','s',' ','N','T','$',0};
 static const WCHAR Windows95[]  = {'$','W','i','n','d','o','w','s',' ','9','5','$',0};
 static const WCHAR LayoutFile[] = {'L','a','y','o','u','t','F','i','l','e',0};
+static const WCHAR Strings[] = {'S','t','r','i','n','g','s',0};
 
 /* extend an array, allocating more memory if necessary */
 static void *grow_array( void *array, unsigned int *count, size_t elem )
@@ -311,10 +312,12 @@
     struct section *strings_section;
     struct line *line;
     struct field *field;
-    unsigned int i;
+    unsigned int i,j;
     int dirid;
     WCHAR *dirid_str, *end;
     const WCHAR *ret = NULL;
+    WCHAR StringLangId[256];
+    TCHAR Lang[5];
 
     if (!*len)  /* empty string (%%) is replaced by single percent */
     {
@@ -323,16 +326,41 @@
     }
     if (file->strings_section == -1) goto not_found;
     strings_section = file->sections[file->strings_section];
-    for (i = 0, line = strings_section->lines; i < strings_section->nb_lines; i++, line++)
-    {
-        if (line->key_field == -1) continue;
-        if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue;
-        if (!file->fields[line->key_field].text[*len]) break;
-    }
-    if (i == strings_section->nb_lines || !line->nb_fields) goto not_found;
-    field = &file->fields[line->first_field];
-    *len = strlenW( field->text );
-    return field->text;
+    for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++)
+    {
+	if (line->key_field == -1) continue;
+	if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue;
+                if (!file->fields[line->key_field].text[*len]) break;
+     }
+     if (j == strings_section->nb_lines || !line->nb_fields) goto not_found;
+     field = &file->fields[line->first_field];
+     *len = strlenW( field->text );
+     ret = field->text;
+     GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, Lang, sizeof(Lang)/sizeof(TCHAR));
+     strcpyW(StringLangId, Strings);
+     strcatW(StringLangId, L".");
+     strcatW(StringLangId, Lang);
+     for (i = 0; i < file->nb_sections; i++)
+     {
+          if (!strcmpiW(file->sections[i]->name,StringLangId))
+	  {
+             strings_section = file->sections[i];
+             for (j = 0, line = strings_section->lines; j < strings_section->nb_lines; j++, line++)
+             {
+                 if (line->key_field == -1) continue;
+                 if (strncmpiW( str, file->fields[line->key_field].text, *len )) continue;
+                 if (!file->fields[line->key_field].text[*len])
+		 {
+                     field = &file->fields[line->first_field];
+                     *len = strlenW( field->text );
+		     ret = field->text;
+                     break;
+                 }
+             }
+	   }
+      }
+      return ret;
+
 
  not_found:  /* check for integer id */
     if ((dirid_str = HeapAlloc( GetProcessHeap(), 0, (*len+1) * sizeof(WCHAR) )))

Modified: branches/matthias-i18n/media/inf/display.inf
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/media/inf/display.inf?rev=34145&r1=34144&r2=34145&view=diff
==============================================================================
--- branches/matthias-i18n/media/inf/display.inf [iso-8859-1] (original)
+++ branches/matthias-i18n/media/inf/display.inf [iso-8859-1] Sat Jun 28 02:56:51 2008
@@ -69,4 +69,11 @@
 DisplayClassName = "Display Adapters"
 
 StdMfg = "(Standard display adapters)"
-VGA.DeviceDesc = "VGA-compatible graphics card"
+VGA.DeviceDesc = "VGA-compatible graphics card"
+
+[Strings.0407]
+ReactOS = "ReactOS Team"
+DisplayClassName = "Grafikkarte"
+
+StdMfg = "(Standard-Grafikkarte)"
+VGA.DeviceDesc = "VGA-kompatible Grafikkarte"

Modified: branches/matthias-i18n/media/inf/fdc.inf
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/media/inf/fdc.inf?rev=34145&r1=34144&r2=34145&view=diff
==============================================================================
--- branches/matthias-i18n/media/inf/fdc.inf [iso-8859-1] (original)
+++ branches/matthias-i18n/media/inf/fdc.inf [iso-8859-1] Sat Jun 28 02:56:51 2008
@@ -62,3 +62,11 @@
 
 GenericMfg = "(Generic floppy disk controllers)"
 *PNP0700.DeviceDesc = "Generic floppy disk controller"
+
+[Strings.0407]
+FDCClassName = "Disketten-Controller"
+
+GenericMfg = "(Generische Disketten-Controller)"
+*PNP0700.DeviceDesc = "Generischer Disketten-Controller"
+
+

Modified: branches/matthias-i18n/media/inf/hdc.inf
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/media/inf/hdc.inf?rev=34145&r1=34144&r2=34145&view=diff
==============================================================================
--- branches/matthias-i18n/media/inf/hdc.inf [iso-8859-1] (original)
+++ branches/matthias-i18n/media/inf/hdc.inf [iso-8859-1] Sat Jun 28 02:56:51 2008
@@ -75,3 +75,12 @@
 GenericMfg = "(Generic IDE controllers)"
 PCI\CC_0101.DeviceDesc = "Generic PCI IDE controller (double channel)"
 *PNP0600.DeviceDesc = "Generic IDE channel"
+
+[Strings.0407]
+HDCClassName = "Festplatten-Controller"
+
+GenericMfg = "(Generische IDE-Controller)"
+*PNP0600.DeviceDesc = "Generischer IDE Kanal"
+PCI\CC_0101.DeviceDesc = "Generische PCI IDE-Controller (2-Kanal)"
+
+

Modified: branches/matthias-i18n/media/inf/machine.inf
URL: http://svn.reactos.org/svn/reactos/branches/matthias-i18n/media/inf/machine.inf?rev=34145&r1=34144&r2=34145&view=diff
==============================================================================
--- branches/matthias-i18n/media/inf/machine.inf [iso-8859-1] (original)
+++ branches/matthias-i18n/media/inf/machine.inf [iso-8859-1] Sat Jun 28 02:56:51 2008
@@ -146,3 +146,40 @@
 PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU to PCI-Bridge"
 PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI-Bridge"
 PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI-Bridge"
+
+[Strings.0407]
+SystemClassName = "Systemgeräte"
+
+GenericMfg = "(Generische Systemgeräte)"
+*PNP0000.DeviceDesc = "Programmierbarer Interrupt-Controller"
+*PNP0001.DeviceDesc = "EISA programmierbarer Interrupt-Controller"
+*PNP0100.DeviceDesc = "System Timer"
+*PNP0200.DeviceDesc = "DMA Controller"
+*PNP0800.DeviceDesc = "Systemlautsprecher"
+*PNP0A03.DeviceDesc = "PCI Bus"
+*PNP0A05.DeviceDesc = "Generischer ACPI Bus"
+*PNP0B00.DeviceDesc = "AT Echtzeituhr"
+*PNP0C01.DeviceDesc = "Systemboard"
+*PNP0C02.DeviceDesc = "Motherboard Ressourcen"
+*PNP0C04.DeviceDesc = "mathematischer Koprozessor"
+*PNP0C0B.DeviceDesc = "ACPI Ventilator"
+*PNP0C0C.DeviceDesc = "ACPI power button device"
+*PNP0C0D.DeviceDesc = "ACPI lid"
+*PNP0C0E.DeviceDesc = "ACPI sleep button device"
+*PNP0C0F.DeviceDesc = "PCI interrupt link device"
+ACPI\FixedButton.DeviceDesc = "ACPI fixed feature button"
+PCI\CC_0600.DeviceDesc = "Standard CPU zu PCI Brücke"
+PCI\CC_0601.DeviceDesc = "Standard PCI zu ISA Brücke"
+PCI\CC_0604.DeviceDesc = "Standard PCI zu PCI Brücke"
+*ThermalZone.DeviceDesc = "ACPI thermal zone"
+
+IntelMfg = "Intel"
+*INT0800.DeviceDesc = "Intel 82802 Firmware Hub Device"
+PCI\VEN_8086&DEV_1237.DeviceDesc = "Intel 440FX - 82441FX PMC [Natoma]"
+PCI\VEN_8086&DEV_2413.DeviceDesc = "Intel 82801AA SMBus"
+PCI\VEN_8086&DEV_7000.DeviceDesc = "Intel 82371SB PIIX3 PCI zu ISA Brücke"
+PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB PCI zu ISA Brücke"
+PCI\VEN_8086&DEV_7113.DeviceDesc = "Intel 82371AB/EB Power Management Controller"
+PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU zu PCI-Brücke"
+PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU zu PCI-Brücke"
+PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU zu PCI-Brücke"



More information about the Ros-diffs mailing list