From 5c28dcaab66e34af718c7ceff6ccc9e33b58b039 Mon Sep 17 00:00:00 2001 From: Iris Morelle Date: Fri, 23 Mar 2018 03:45:09 -0300 Subject: [PATCH] i18n: Forcefully pull gettext.hpp into formula/string_utils.hpp There are cases (deprecation.cpp for one) where string_utils.hpp is included first, which causes the VGETTEXT/VNGETTEXT definition to use the textdomain-less (a.k.a. forced wesnoth-lib textdomain) overloads of vgettext() and vngettext(), because GETTEXT_DOMAIN has not yet been defined by anything. This again results in strings being looked up in catalogues where xgettext is not adding them. This is a companion for PR #2711 I should've noticed sooner. Without it, there were still cases where interpolated strings would not be translated due to vgettext() using the wrong textdomain for them. I ran a quick scan on the codebase to make sure there aren't any files including formula/string_utils.hpp before defining their own GETTEXT_DOMAIN instead of the gettext.hpp default. --- src/formula/string_utils.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/formula/string_utils.hpp b/src/formula/string_utils.hpp index d920de4f878b..7c8a4908b456 100644 --- a/src/formula/string_utils.hpp +++ b/src/formula/string_utils.hpp @@ -15,6 +15,9 @@ #pragma once +// Need this to get the default GETTEXT_DOMAIN for VGETTEXT/VNGETTEXT +#include "gettext.hpp" + #include "serialization/string_utils.hpp" class variable_set;