Skip to content

Commit

Permalink
Allow translatable strings to display carets to the user (#4359)
Browse files Browse the repository at this point in the history
Treat "editor^The overlays '^Uf' and '^Ufi' are deprecated because ..."
as a having translation hint "editor", and show "The overlays ..." to the
user. This disallows using carets inside the translation hint itself.

Code already reviewed in the discussion in #4359.
  • Loading branch information
stevecotton committed Oct 6, 2019
1 parent a9254f4 commit 5a1a866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gettext.cpp
Expand Up @@ -405,7 +405,7 @@ std::string dsgettext (const char * domainname, const char *msgid)
{
std::string msgval = dgettext (domainname, msgid);
if (msgval == msgid) {
const char* firsthat = std::strrchr (msgid, '^');
const char* firsthat = std::strchr (msgid, '^');
if (firsthat == nullptr)
msgval = msgid;
else
Expand All @@ -420,7 +420,7 @@ std::string dsngettext (const char * domainname, const char *singular, const cha
std::lock_guard<std::mutex> lock(get_mutex());
std::string msgval = bl::dngettext(domainname, singular, plural, n, get_manager().get_locale());
if (msgval == singular) {
const char* firsthat = std::strrchr (singular, '^');
const char* firsthat = std::strchr (singular, '^');
if (firsthat == nullptr)
msgval = singular;
else
Expand Down

0 comments on commit 5a1a866

Please sign in to comment.