summaryrefslogtreecommitdiff
path: root/lang/tests/tooltips.cpp
blob: 66b6d72322f649f642ac0ae3ad8547c8ac47b2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "turns/lang/messages.hpp"

#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>

#include <libintl.h>

#include <format>
#include <string>

namespace turns::lang::tests
{

TEST_CASE("Tooltip translations")
{
  auto message = GENERATE(
    tooltips::add_a_participant
  );
  
  auto locale = GENERATE(
    "de_CH.UTF-8",
    "de_DE.UTF-8",
    "de_AT.UTF-8"
  );

  SECTION(std::format("'{}' has a translation in '{}'", message, locale))
  {
    setlocale(LC_ALL, locale);
    REQUIRE(std::string{gettext(message)} != message);
  }
}

}