From b866d1fc407d13d91091494051cb0bab9f6849c8 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 8 Feb 2015 17:08:35 +0000 Subject: [PATCH] Load CEF locale files from resources/l10n. Also copy across the default (en-US) pack file after building LOOT. These changes have no effect except when debugging, in which case they remove a few error messages from the log. --- CMakeLists.txt | 8 ++++++++ src/gui/main_win.cpp | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd7478d6..b3ae8a9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,3 +281,11 @@ FOREACH(cef_resource cef.pak cef_100_percent.pak cef_200_percent.pak devtools_re "${CMAKE_SOURCE_DIR}/${CEF_ROOT}/Resources/${cef_resource}" $) ENDFOREACH() + +# Copy CEF locale resources. This is just to reduce error messages while debugging. +FOREACH(cef_resource en-US.pak) + add_custom_command(TARGET LOOT POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/${CEF_ROOT}/Resources/locales/${cef_resource}" + $/resources/l10n) +ENDFOREACH() diff --git a/src/gui/main_win.cpp b/src/gui/main_win.cpp index 6881363b..392aad9e 100644 --- a/src/gui/main_win.cpp +++ b/src/gui/main_win.cpp @@ -54,6 +54,11 @@ CefSettings GetCefSettings(bool debuggingEnabled) { // Disable pack file loading if debugging is not enabled. cef_settings.pack_loading_disabled = !debuggingEnabled; + + // If pack file loading is not disabled, load locale pack files from LOOT's + // l10n path. + CefString(&cef_settings.locales_dir_path).FromString(g_path_l10n.string()); + return cef_settings; } @@ -140,7 +145,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd ReleaseMutex(hMutex); // Delete the folders CEF generates that LOOT doesn't need. - boost::filesystem::remove_all(boost::filesystem::current_path() / "locales"); boost::filesystem::remove_all(boost::filesystem::current_path() / "pdf.dll"); return 0;