Skip to content

Commit

Permalink
Update vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Oct 10, 2024
1 parent c512000 commit b1337b4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 9 additions & 9 deletions src/localization/gettext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit b1337b4

Please sign in to comment.