コード例 #1
0
        private static void RunOptions(Options opts)
        {
            try
            {
                CultureInfo ci = new CultureInfo(opts.Locale);
                if (!CultureInfo.GetCultures(CultureTypes.AllCultures).Contains(ci))
                {
                    throw new CultureNotFoundException();
                }
            }
            catch (CultureNotFoundException)
            {
                Console.WriteLine("Locale " + opts.Locale + " is not supported by this system. Do you want to proceed? (Y/N)");
                if (Console.ReadKey().Key != ConsoleKey.Y)
                {
                    return;
                }
            }
            HTMLDirectory         htmlDirectory = new HTMLDirectory(opts.HtmlDirectory);
            LocaleChangeProcessor processor     = new LocaleChangeProcessor(htmlDirectory, opts.Locale, opts.Verbose);

            processor.Process();
        }
コード例 #2
0
 public LocaleChangeProcessor(HTMLDirectory htmlDirectory, string requestedLocale, bool verbose)
 {
     this.htmlDirectory   = htmlDirectory;
     this.requestedLocale = requestedLocale;
     this.verbose         = verbose;
 }