Skip to content

Commit

Permalink
string::append -> string+
Browse files Browse the repository at this point in the history
  • Loading branch information
y5nw committed Oct 9, 2024
1 parent 510a2fd commit 55b42a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void Translations::clear()
const std::wstring &Translations::getTranslation(
const std::wstring &textdomain, const std::wstring &s) const
{
std::wstring key = textdomain + L"|"; key.append(s);
std::wstring key = textdomain + L"|" + s;
auto it = m_translations.find(key);
if (it != m_translations.end())
return it->second;
Expand All @@ -62,7 +62,7 @@ const std::wstring &Translations::getTranslation(
const std::wstring &Translations::getPluralTranslation(
const std::wstring &textdomain, const std::wstring &s, unsigned long int number) const
{
std::wstring key = textdomain + L"|"; key.append(s);
std::wstring key = textdomain + L"|" + s;
auto it = m_plural_translations.find(key);
if (it != m_plural_translations.end()) {
auto n = (*(it->second.first))(number);
Expand All @@ -80,7 +80,7 @@ const std::wstring &Translations::getPluralTranslation(
void Translations::addTranslation(
const std::wstring &textdomain, const std::wstring &original, const std::wstring &translated)
{
std::wstring key = textdomain + L"|"; key.append(original);
std::wstring key = textdomain + L"|" + original;
if (!translated.empty()) {
m_translations.emplace(std::move(key), std::move(translated));
}
Expand All @@ -99,7 +99,7 @@ void Translations::addPluralTranslation(
errorstream << "Translations: incorrect number of plural translations (expected " << plural->size() << ", got " << translated.size() << ")" << std::endl;
return;
}
std::wstring key = textdomain + L"|"; key.append(original);
std::wstring key = textdomain + L"|" + original;
m_plural_translations.emplace(std::move(key), std::pair(plural, translated));
}

Expand Down

0 comments on commit 55b42a6

Please sign in to comment.