feat: add app.getSystemLocale() method (#35697)

* feat: add app.getSystemLocale() method

* Update shell/browser/electron_browser_main_parts.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* Change methods to be const

* Apply PR feedback

* Fix mac compile

* Add missing scope

* Apply style changes

* Change note

* Add braces to get the comment indentation right

* Change to static

* Apply PR feedback

* Fix the documentation

* Remove extraneous file

Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Raymond Zhao 2022-09-23 11:50:46 -07:00 committed by GitHub
parent 626e248dea
commit 8a0b4fa338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 69 additions and 6 deletions

View file

@ -49,6 +49,9 @@ class BrowserProcessImpl : public BrowserProcess {
void PostDestroyThreads() {}
void PostMainMessageLoopRun();
void SetSystemLocale(const std::string& locale);
const std::string& GetSystemLocale() const;
void EndSession() override {}
void FlushLocalStateAndReply(base::OnceClosure reply) override {}
bool IsShuttingDown() override;
@ -110,6 +113,7 @@ class BrowserProcessImpl : public BrowserProcess {
#endif
std::unique_ptr<PrefService> local_state_;
std::string locale_;
std::string system_locale_;
};
#endif // ELECTRON_SHELL_BROWSER_BROWSER_PROCESS_IMPL_H_