Page 1 of 1
Renderer process ignores language
Posted: Mon Apr 23, 2018 10:46 am
by Albus
Hi, I have found that all of my renderer processes are spawend with the parameter --lang=en-US, although I have initialized cef with language de. And the gpu-process is correctly spawned with --lang=de. How is this possible that the renderer processes are spawend with a wrong language? And how can I correct this issue?
Re: Renderer process ignores language
Posted: Mon Apr 23, 2018 10:57 am
by Albus
It seems that chromium still sends the correct language header. But nethertheless the renderer processes should be startet with the correct language.
Re: Renderer process ignores language
Posted: Mon Apr 23, 2018 3:08 pm
by salvadordf
Without seeing your code it's difficult to guess what's going on.
The GlobalCEFApp.Locale property and the "lang" command-line switch are used for the same thing : setting the context menu language and other GUI elements.
CEF4Delphi passes the GlobalCEFApp.Locale value inside a TCefSettings record to cef_initialize when you call GlobalCEFApp.StartMainProcess.
If you don't set GlobalCEFApp.Locale then CEF uses "en-US" as the GUI language.
This property must not be confused with GlobalCEFApp.AcceptLanguageList that is used to set the preferred web page language.
Re: Renderer process ignores language
Posted: Tue Apr 24, 2018 7:40 am
by Albus
Hi, I'm setting both, GlobalCEFApp.AcceptedLanguageList and GlobalCEFApp.Locale. The first (AcceptedLanguageList) for example with "de,en-US" and the second (Locale) with "de".
The problem is that the gpu process is spawned correctly, only the renderer process are spawend wrong. Possibly this is a bug in cef itself.
Re: Renderer process ignores language
Posted: Tue Apr 24, 2018 3:54 pm
by salvadordf
I tested this issue with the official CEF sample application and it also uses the wrong "lang" parameter in the renderer process.
However, the context menu is correctly translated.
Looks like CEF passes the correct lang parameter to the processes that really need it.