From b1337b42fddab6e4f8856e10355ea8b496b44323 Mon Sep 17 00:00:00 2001 From: Nick Logozzo Date: Thu, 10 Oct 2024 08:35:48 -0400 Subject: [PATCH] Update vcpkg --- .github/workflows/linux.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- src/localization/gettext.cpp | 18 +++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 8b22cbb..4be0191 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -42,7 +42,7 @@ jobs: with: pkgs: boost-json curl gettext-libintl glib gtest libsecret maddy openssl triplet: x64-linux - revision: 0affe8710a4a5b26328e909fe1ad7146df39d108 + revision: c45ac46dcc16dd588daa029f7ce5bcacc5d7645b token: ${{ secrets.GITHUB_TOKEN }} github-binarycache: true - name: "Build" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 599856e..07070f5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -31,7 +31,7 @@ jobs: with: pkgs: boost-json curl gettext-libintl glib gtest maddy openssl triplet: arm64-osx - revision: 0affe8710a4a5b26328e909fe1ad7146df39d108 + revision: c45ac46dcc16dd588daa029f7ce5bcacc5d7645b token: ${{ secrets.GITHUB_TOKEN }} github-binarycache: true - name: "Build" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 61bd45a..4f88a9a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,7 +29,7 @@ jobs: with: pkgs: boost-json curl gettext-libintl gtest maddy sqlcipher triplet: x64-windows - revision: 0affe8710a4a5b26328e909fe1ad7146df39d108 + revision: c45ac46dcc16dd588daa029f7ce5bcacc5d7645b token: ${{ secrets.GITHUB_TOKEN }} github-binarycache: true - name: "Build" diff --git a/src/localization/gettext.cpp b/src/localization/gettext.cpp index 6083d60..25730fb 100644 --- a/src/localization/gettext.cpp +++ b/src/localization/gettext.cpp @@ -9,7 +9,7 @@ using namespace Nickvision::System; namespace Nickvision::Localization { - static std::string m_domainName; + static std::string s_domainName; bool Gettext::init(const std::string& domainName) { @@ -18,14 +18,14 @@ namespace Nickvision::Localization { bool res{ true }; setlocale(LC_ALL, ""); - m_domainName = StringHelpers::lower(StringHelpers::replace(domainName, " ", "")); + s_domainName = StringHelpers::lower(StringHelpers::replace(domainName, " ", "")); #ifdef _WIN32 - res = res && (wbindtextdomain(m_domainName.c_str(), Environment::getExecutableDirectory().c_str()) != nullptr); + res = res && (wbindtextdomain(s_domainName.c_str(), Environment::getExecutableDirectory().c_str()) != nullptr); #else - res = res && (bindtextdomain(m_domainName.c_str(), Environment::getExecutableDirectory().c_str()) != nullptr); - res = res && (bind_textdomain_codeset(m_domainName.c_str(), "UTF-8") != nullptr); + res = res && (bindtextdomain(s_domainName.c_str(), Environment::getExecutableDirectory().c_str()) != nullptr); + res = res && (bind_textdomain_codeset(s_domainName.c_str(), "UTF-8") != nullptr); #endif - res = res && (textdomain(m_domainName.c_str()) != nullptr); + res = res && (textdomain(s_domainName.c_str()) != nullptr); initialized = true; return res; } @@ -34,12 +34,12 @@ namespace Nickvision::Localization const std::string& Gettext::getDomainName() { - return m_domainName; + return s_domainName; } const char* Gettext::pgettext(const char* context, const char* msg) { - const char* translation{ dcgettext(m_domainName.c_str(), context, LC_MESSAGES) }; + const char* translation{ dcgettext(s_domainName.c_str(), context, LC_MESSAGES) }; if (translation == context) { return msg; @@ -49,7 +49,7 @@ namespace Nickvision::Localization const char* Gettext::pngettext(const char* context, const char* msg, const char* msgPlural, unsigned long n) { - const char* translation{ dcngettext(m_domainName.c_str(), context, msgPlural, n, LC_MESSAGES) }; + const char* translation{ dcngettext(s_domainName.c_str(), context, msgPlural, n, LC_MESSAGES) }; if (translation == context || translation == msgPlural) { return n == 1 ? msg : msgPlural;