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.
This commit is contained in:
Oliver Hamlet
2015-02-08 17:08:35 +00:00
parent 8fd3194876
commit b866d1fc40
2 changed files with 13 additions and 1 deletions
+8
View File
@@ -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}"
$<TARGET_FILE_DIR:LOOT>)
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}"
$<TARGET_FILE_DIR:LOOT>/resources/l10n)
ENDFOREACH()
+5 -1
View File
@@ -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;