Can not change language with cobalt preload mode

125 views Asked by At

With cobalt preload mode, it can not change the language as the language setting is set at the initialization of cobalt, so is there a way to to support it?

//src/cobalt/browser/application.cc
// Get the system language and initialize our localized strings.
std::string language = base::GetSystemLanguage();  
base::LocalizedStrings::GetInstance()->Initialize(language);
1

There are 1 answers

2
David Ghandehari On BEST ANSWER

The language is sent with the initial URL request in the HTTP headers, so if the language changes, you will want to reload the application URL anyway. Otherwise, the UI will not be in the correct language.

So, if the language changes, I would suggest shutting down Cobalt and starting it again, so hopefully it will be loaded in the new language by the time the user switches to it.

Alternatively, when launching Cobalt, you could check to see if the language is different and restart it at that point, but then the user will definitely have to wait for the full application startup.