From 1f388f6fe11a852a1260f9aaa30889a322de46f0 Mon Sep 17 00:00:00 2001 From: Madman10K Date: Fri, 1 Sep 2023 15:03:22 +0300 Subject: [PATCH] Add I18N module --- CMakeLists.txt | 21 +++++++++++++++++---- Config/Translations/translation-base.yaml | 3 --- Config/Translations/ui18n-config.yaml | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) delete mode 100644 Config/Translations/translation-base.yaml create mode 100644 Config/Translations/ui18n-config.yaml diff --git a/CMakeLists.txt b/CMakeLists.txt index 0951a98..856218f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -214,6 +214,23 @@ if (NOT USE_CLI_PARSER_MODULE OR NOT BUILD_VARIANT_VENDOR) add_subdirectory(Framework/Modules/CLIParser/ThirdParty/UntitledCLIParser/ThirdParty/utfcpp) endif() +if (USE_I18N_MODULE) + if (BUILD_VARIANT_VENDOR) + set(USE_PRECONFIGURED_YAML ON) + add_subdirectory(Framework/Modules/i18n/ThirdParty/UntitledI18N) + list(APPEND ENABLED_LIBRARIES UntitledI18N) + else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(UntitledI18N REQUIRED UntitledI18N) + + link_directories(${UntitledI18N_LIBRARY_DIRS}) + list(APPEND LM_INCLUDE_DIRS ${UntitledI18N_INCLUDE_DIRS}) + list(APPEND ENABLED_LIBRARIES UntitledI18N) + pkg_get_variable(UI18N_COMPILE_DEFS UntitledI18N compile_defs) + list(APPEND VENDOR_COMPILE_DEFS ${UI18N_COMPILE_DEFS}) + endif() +endif() + # ---------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------- Add files and directories --------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------- @@ -388,10 +405,6 @@ if (BUILD_VARIANT_VENDOR) enable_module_defs(UIMGUI_BUILD_VARIANT_VENDOR) endif() -if (USE_I18N_MODULE) - enable_module_defs(UIMGUI_I18N_MODULE_ENABLED) -endif() - if (USE_PLOTTING_MODULE) enable_module_defs(UIMGUI_PLOTTING_MODULE_ENABLED) endif() diff --git a/Config/Translations/translation-base.yaml b/Config/Translations/translation-base.yaml deleted file mode 100644 index c4983cf..0000000 --- a/Config/Translations/translation-base.yaml +++ /dev/null @@ -1,3 +0,0 @@ -origin-locale: "en_US" -strings: - - "Add strings as members of the array here!" \ No newline at end of file diff --git a/Config/Translations/ui18n-config.yaml b/Config/Translations/ui18n-config.yaml new file mode 100644 index 0000000..7494e58 --- /dev/null +++ b/Config/Translations/ui18n-config.yaml @@ -0,0 +1,2 @@ +terms: + - example: example \ No newline at end of file