Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Renderer process ignores language

Post Reply
Albus

Renderer process ignores language

Post 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?
Albus

Re: Renderer process ignores language

Post by Albus »

It seems that chromium still sends the correct language header. But nethertheless the renderer processes should be startet with the correct language.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Renderer process ignores language

Post 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.
Albus

Re: Renderer process ignores language

Post 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.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Renderer process ignores language

Post 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.
Post Reply