///CEF settings Settings csettings = new CefSharp.Settings(); //csettings.PackLoadingDisabled = true; csettings.LocalesDirPath = Application.StartupPath + "\\locales"; //csettings.Locale = "it-IT"; csettings.Locale = "it"; do { CefSharp.CEF.Initialize(csettings); } while (!CefSharp.CEF.IsInitialized);
///Browser settings BrowserSettings bsettings = new BrowserSettings(); bsettings.EncodingDetectorEnabled = true;///Init browser //_webBrowser = new WebView(); _webBrowser = new WebView(string.Empty, bsettings); _webBrowser.Dock = DockStyle.Fill; _webBrowser.MenuHandler = this; _webBrowser.RequestHandler = this; _webBrowser.CreateControl(); this.Controls.Add(_webBrowser);///Loadurl _webBrowser.PropertyChanged += new PropertyChangedEventHandler((sender, e) => { if (e.PropertyName == "IsBrowserInitialized" && _webBrowser.IsBrowserInitialized) { _webBrowser.Load(url); } });Anyone can hekp me to change the default locale?Thanks.
bool IRequestHandler.OnBeforeResourceLoad(IWebBrowser browser, IRequestResponse requestResponse) { //string txt = ""; //foreach (KeyValuePair<string, string> header in requestResponse.Request.GetHeaders()) //{ // txt += header.ToString()+"\n"; //} //Dbg.Print(txt); ///Verifica che la url contenga una delle azioni specificate //if (_actions.Any(requestResponse.Request.Url.Contains)) //{ // ///Progress // Dlg.ShowProgress(_max, _step, "Caricamento in corso..."); //} Dictionary<string, string> headers = new Dictionary<string, string>(); headers.Add("Accept-Language", "it-IT"); requestResponse.Request.SetHeaders(headers); return false; }
Hey Eliozzzzzz, just wanted to say thanks for following up with a solution a year and a half ago. It majorly helped me today. Cheers from around the world!
--
You received this message because you are subscribed to a topic in the Google Groups "CefSharp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cefsharp/Klvi9TOObX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp.
For more options, visit https://groups.google.com/d/optout.