Locale could not be found for en-US

1,280 views
Skip to first unread message

jwwi...@gmail.com

unread,
Jun 5, 2016, 9:42:11 PM6/5/16
to CEF Python
I'm on OSX 10.11.4, here's the version of Python I'm using (I downloaded it from Python.org) -
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

So when I try to run the Kivy sample app here - https://github.com/cztomczak/cefpython/blob/master/src/linux/binaries_64bit/kivy_.py

I get the following error -
[CEF Python] Initialize() called
[CEF Python] CefExecuteProcess(): exitCode = -1
[CEF Python] CefInitialize()
[CEF Python] App_OnBeforeCommandLineProcessing_BrowserProcess()
[CEF Python] App: Command line string for the browser process: --browser-subprocess-path=/Users/Jon/Downloads/cefpython3-31.2-macosx-setup 5/cefpython3/subprocess --lang=en-US --log-file=debug.log --log-severity=info --enable-release-dcheck --resources-dir-path=/Users/Jon/Downloads/cefpython3-31.2-macosx-setup 5/cefpython3 --locales-dir-path=/Users/Jon/Downloads/cefpython3-31.2-macosx-setup 5/cefpython3/locales --remote-debugging-port=65436 --no-sandbox
[0605/180015:WARNING:resource_bundle.cc(269)] locale_file_path.empty()
[0605/180015:FATAL:main_delegate.cc(449)] Check failed: !loaded_locale.empty(). Locale could not be found for en-US

I've tried searching for answers but they all seem to be quite old and refer to a locale.pak that I can't seem to find. How can I resolve this issue?

cztomczak

unread,
Jun 6, 2016, 12:11:23 AM6/6/16
to CEF Python
Setting ApplicationSettings.locale to "en" should fix this. See Issue #163: https://github.com/cztomczak/cefpython/issues/163

jwwi...@gmail.com

unread,
Jun 6, 2016, 9:20:33 AM6/6/16
to CEF Python
Yea, I saw that issue but because I'm not familar with this project I wasn't sure where to make those changes. I tried adding "locale":"en" here-https://github.com/cztomczak/cefpython/blob/master/src/linux/binaries_64bit/kivy_.py#L142 but that didn't work. I kept getting the same error, where should I make those changes?

cztomczak

unread,
Jun 6, 2016, 10:14:32 AM6/6/16
to CEF Python
I've only tested setting locale using the locale_pak switch as in the wxpython.py example:

g_switches = {
       
"locale_pak": cefpython.GetModuleDirectory()
           
+"/Resources/en.lproj/locale.pak"
}
cefpython
.Initialize(g_applicationSettings, g_switches)

I thought that locale option would work as well, but it wasn't tested. There are some differences for options locales_dir_path and resources_dir_path options on each platform. Use the mac/wxpython.py example as a base:

On Linux these options and its values look different:

jwwi...@gmail.com

unread,
Jun 6, 2016, 10:24:26 AM6/6/16
to CEF Python
It's working now, thanks for all of the help!

I added this to the settings -
"resources_dir_path": cefpython.GetModuleDirectory()+"/Resources",

and then added this array -
switches = {
# On Mac it is required to provide path to a specific
# locale.pak file. On Win/Linux you only specify the
# ApplicationSettings.locales_dir_path option.
"locale_pak": cefpython.GetModuleDirectory()
+"/Resources/en.lproj/locale.pak",

# "proxy-server": "socks5://127.0.0.1:8888",
# "no-proxy-server": "",
# "enable-media-stream": "",
# "remote-debugging-port": "12345",
# "disable-gpu": "",
# "--invalid-switch": "" -> Invalid switch name
}

Then initialized CEF like so:
cefpython.Initialize(settings, switches)

Reply all
Reply to author
Forward
0 new messages