commit 4f1d6cb6e68a1231c8bcf4757638060b1b27d143 Author: Ahmed Siam Date: Sat Jun 24 13:43:57 2023 +0300 Make the locales_data pointer a data member in I18n class diff --git a/src/i18n.cpp b/src/i18n.cpp index 37cfa1e..12c1c46 100644 --- a/src/i18n.cpp +++ b/src/i18n.cpp @@ -24,7 +24,7 @@ I18n::I18n(const char *locales_path) : resource("", "", status) std::streamsize file_size = std::filesystem::file_size(std::filesystem::path{locales_path}); - auto locales_data = std::make_unique(file_size); + locales_data = std::make_unique(file_size); file.read(locales_data.get(), file_size); diff --git a/src/i18n.h b/src/i18n.h index 0479073..0b77dec 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -4,11 +4,13 @@ #include #include #include +#include class I18n { private: icu::ResourceBundle resource; + std::unique_ptr locales_data; UErrorCode status; public: I18n(const char *locales_path);