From b28a4f5ac91d97ebe38fad4ec0f59bac9b5237d0 Mon Sep 17 00:00:00 2001 From: Ivan Ushakov Date: Thu, 23 May 2024 17:01:23 +0300 Subject: [PATCH] French language support --- MechoSoma/CMakeLists.txt | 22 ++++++++++++++++------ MechoSoma/XTool/filesystem.cpp | 6 +++--- MechoSoma/app/main.cpp | 7 ++++--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/MechoSoma/CMakeLists.txt b/MechoSoma/CMakeLists.txt index 2319ea8..4a0f7fa 100644 --- a/MechoSoma/CMakeLists.txt +++ b/MechoSoma/CMakeLists.txt @@ -558,12 +558,22 @@ elseif (APPLE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${APPLICATION_SOURCES}) set_property(TARGET ${APPLICATION_NAME} PROPERTY MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Info.plist.in") - target_compile_options(${APPLICATION_NAME} PRIVATE -x objective-c++) - target_link_libraries(${APPLICATION_NAME} PRIVATE stdc++ - "-framework CoreFoundation" "-framework Cocoa" "-framework QuartzCore" "-framework OpenGL" - "-framework CoreAudio" "-framework AudioToolbox" "-framework ForceFeedback" "-framework CoreHaptics" - "-framework GameController" "-framework IOKit" "-framework Carbon" "-framework Metal" - objc ${LIBRARY_NAME} ${COMMON_APPLICATION_LIBRARIES}) + target_link_libraries(${APPLICATION_NAME} PRIVATE + "-framework AudioToolbox" + "-framework Carbon" + "-framework Cocoa" + "-framework CoreAudio" + "-framework CoreFoundation" + "-framework CoreHaptics" + "-framework ForceFeedback" + "-framework GameController" + "-framework IOKit" + "-framework Metal" + "-framework OpenGL" + "-framework QuartzCore" + ${LIBRARY_NAME} + ${COMMON_APPLICATION_LIBRARIES} + ) if (STEAM_VERSION) set(APP_BUNDLE_CONTENTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app/Contents") diff --git a/MechoSoma/XTool/filesystem.cpp b/MechoSoma/XTool/filesystem.cpp index 78d97da..d36cd4f 100644 --- a/MechoSoma/XTool/filesystem.cpp +++ b/MechoSoma/XTool/filesystem.cpp @@ -7,10 +7,10 @@ #include namespace localization { - std::unordered_set supportedLanguages = { - "ru", "en", "it", "cz", "lt" + const std::unordered_set supportedLanguages = { + "cz", "en", "fr", "it", "lt", "ru" }; - std::unordered_set localizedFiles = { + const std::unordered_set localizedFiles = { "resource/iscreen/itext.scb", "resource/iscreen/iscreen.scb", "resource/iscreen/doggy.scb", diff --git a/MechoSoma/app/main.cpp b/MechoSoma/app/main.cpp index b467357..57b9be5 100644 --- a/MechoSoma/app/main.cpp +++ b/MechoSoma/app/main.cpp @@ -92,15 +92,16 @@ int game_main(int argc, char const *argv[]) { localization::setLanguage(gpx()->sys()->getLanguage().c_str()); #else int main(int argc, char const *argv[]) { - #ifdef STEAM_VERSION1 + #ifdef STEAM_VERSION if (!SteamAPI_Init()) { return 1; } using LanguagePair = std::pair; - constexpr std::array map{ - LanguagePair("english", "en"), + constexpr std::array map{ LanguagePair("czech", "cz"), + LanguagePair("english", "en"), + LanguagePair("french", "fr"), LanguagePair("italian", "it"), LanguagePair("lithuanian", "lt"), LanguagePair("russian", "ru")