peiyongz    2002/11/05 13:15:16

  Modified:    c/tools/NLS/Xlat Xlat_ICUResourceBundle.cpp
  Log:
  generate correct <locale>.txt file
  
  Revision  Changes    Path
  1.2       +28 -4     xml-xerces/c/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp
  
  Index: Xlat_ICUResourceBundle.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/tools/NLS/Xlat/Xlat_ICUResourceBundle.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Xlat_ICUResourceBundle.cpp        30 Sep 2002 22:09:28 -0000      1.1
  +++ Xlat_ICUResourceBundle.cpp        5 Nov 2002 21:15:16 -0000       1.2
  @@ -57,6 +57,9 @@
   /*
    * $Id$
    * $Log$
  + * Revision 1.2  2002/11/05 21:15:16  peiyongz
  + * generate correct <locale>.txt file
  + *
    * Revision 1.1  2002/09/30 22:09:28  peiyongz
    * To generate icu resource file (in text) for error message.
    *
  @@ -207,7 +210,28 @@
       const unsigned int bufSize = 4095;
       XMLCh tmpBuf[bufSize + 1];
   
  -    swprintf(tmpBuf, L"%s/%s_%s.Msg", outPath, L"root", locale);
  +    //
  +    // we got to comform to locale specs
  +    // that is en_US
  +    //
  +    XMLCh tempLocale[bufSize+1];
  +    XMLCh tempLan[64];
  +    int lang_end = XMLString::indexOf(locale, chUnderscore);
  +    if (lang_end != -1)
  +    {
  +        XMLString::subString(tempLan, locale, 0, lang_end);
  +        tempLan[lang_end] = 0;
  +        XMLString::lowerCase(tempLan);
  +        XMLString::copyString(tempLocale, tempLan);
  +        tempLocale[lang_end] = 0;
  +        XMLString::catString(&(tempLocale[lang_end]), &(locale[lang_end]));
  +    }
  +    else
  +    {
  +        XMLString::copyString(tempLocale, locale);
  +    }
  +
  +    swprintf(tmpBuf, L"%s/%s.txt", outPath, tempLocale);
       fOutFl = _wfopen(tmpBuf, L"wt");
       if (!fOutFl)
       {
  @@ -216,6 +240,6 @@
       }
   
       // Set the message delimiter
  -    fwprintf(fOutFl, L"root { \n");
  +    fwprintf(fOutFl, L"%s { \n", tempLocale);
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to