windows: simplify handling of gettext

fixes binplace on first build
This commit is contained in:
Shawn Hoffman
2022-04-02 15:22:02 -07:00
parent 113fdc959d
commit db4d81b9a8
8 changed files with 23 additions and 319 deletions

View File

@ -466,11 +466,12 @@ if(GETTEXT_MSGFMT_EXECUTABLE)
foreach(po ${LINGUAS})
get_filename_component(lang ${po} NAME_WE)
if(WIN32)
set(mo_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Languages/${lang})
set(mo_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Languages)
set(mo ${mo_dir}/${lang}.mo)
else()
set(mo_dir ${CMAKE_CURRENT_BINARY_DIR}/${lang})
set(mo ${mo_dir}/dolphin-emu.mo)
endif()
set(mo ${mo_dir}/dolphin-emu.mo)
target_sources(dolphin-emu PRIVATE ${mo})
source_group("Localization\\\\Generated" FILES ${mo})

View File

@ -275,7 +275,7 @@ static bool TryInstallTranslator(const QString& exact_language_code)
std::string lang = qlang.toStdString();
auto filename =
#if defined _WIN32
File::GetExeDirectory() + StringFromFormat("/Languages/%s/dolphin-emu.mo", lang.c_str())
File::GetExeDirectory() + StringFromFormat("/Languages/%s.mo", lang.c_str())
#elif defined __APPLE__
File::GetBundleDirectory() +
StringFromFormat("/Contents/Resources/%s.lproj/dolphin-emu.mo", lang.c_str())