Skip to content

Commit

Permalink
i18n: Forcefully pull gettext.hpp into formula/string_utils.hpp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
irydacea committed Mar 23, 2018
1 parent c5b3947 commit 5c28dca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/formula/string_utils.hpp
Expand Up @@ -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;
Expand Down

0 comments on commit 5c28dca

Please sign in to comment.