Skip to content

Commit

Permalink
feat: change locale file location
Browse files Browse the repository at this point in the history
  • Loading branch information
Serein207 committed Sep 25, 2024
1 parent 0b92226 commit dcca2d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/Infrastructure/Utils/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ const std::filesystem::path configDir =

inline toml::table config;

const std::filesystem::path localePath =
#ifdef EVENTO_DEBUG
LOCALE_DIR;
#else
#ifdef PLATFORM_LINUX
std::filesystem::path("/usr/share/locale");
#else
std::filesystem::current_path() / "locale";
#endif // PLATFORM_LINUX
#endif // EVENTO_DEBUG

inline struct Settings {
bool minimalToTray;
bool noticeBegin;
Expand Down
2 changes: 1 addition & 1 deletion src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char** argv) {
evento::initConfig();
spdlog::info("SAST Evento version: v" VERSION_FULL);

bindtextdomain("sast-evento", LOCALE_DIR);
bindtextdomain("sast-evento", evento::localePath.string().c_str());
std::locale::global(std::locale(""));

evento::UiBridge uiBridge(App::create());
Expand Down

0 comments on commit dcca2d7

Please sign in to comment.