Пример #1
0
 private static ResourceBundle GetBundleImpl(String bundleName,
                                             Locale locale_0, Assembly loader_1)
 {
     if (bundleName != null)
     {
         ResourceBundle bundle;
         if (!locale_0.Equals(Locale.GetDefault()))
         {
             String localeName = locale_0.ToString();
             if (localeName.Length > 0)
             {
                 localeName = "_" + localeName; //$NON-NLS-1$
             }
             if ((bundle = HandleGetBundle(bundleName, localeName, false,
                                           loader_1)) != null)
             {
                 return(bundle);
             }
         }
         String localeName_2 = Locale.GetDefault().ToString();
         if (localeName_2.Length > 0)
         {
             localeName_2 = "_" + localeName_2; //$NON-NLS-1$
         }
         if ((bundle = HandleGetBundle(bundleName, localeName_2, true, loader_1)) != null)
         {
             return(bundle);
         }
         throw new MissingManifestResourceException("KA029"); //$NON-NLS-1$
     }
     throw new NullReferenceException();
 }
Пример #2
0
        public void TestScratch()
        {
            String[]          strMonths = { "Januari", "Pebruari", "Maret",   "April",     "Mei",
                                            "Juni",             "Juli",     "Agustus", "September", "Oktober","Nopember",
                                            "Desember" };
            String[]          strShortMonths = { "Jan", "Peb", "Mar", "Apr", "Mei", "Jun",
                                                 "Jul",          "Agt", "Sep", "Okt", "Nop", "Des" };
            String[]          strWeeks = { "", "Minggu", "Senin", "Selasa", "Rabu", "Kamis",
                                           "Jumat",     "Sabtu" };
            DateFormatSymbols dfsDate = new DateFormatSymbols(
                new ILOG.J2CsMapping.Util.Locale("id", "ID"));

            dfsDate.SetMonths(strMonths);
            dfsDate.SetShortMonths(strShortMonths);
            dfsDate.SetWeekdays(strWeeks);
            ULocale uloInd = dfsDate.GetLocale(IBM.ICU.Util.ULocale.ACTUAL_LOCALE);

            if (uloInd == null)
            {
                Errln("did not get the expected ULocale");
            }
            Logln(uloInd.ToString());
            ILOG.J2CsMapping.Util.Locale locInd = uloInd.ToLocale();
            if (locInd == null)
            {
                Errln("did not get the expected result");
            }
            Logln(locInd.ToString());
        }