Luanti 5.16.0-dev
Loading...
Searching...
No Matches
test_translations.cpp File Reference
#include "translation.h"
#include "filesys.h"
#include "content/subgames.h"
#include "catch.h"
Include dependency graph for test_translations.cpp:

Macros

#define CONTEXT   L"context"
#define TEXTDOMAIN_PO   L"translation_po"
#define TEST_PO_NAME   "translation_po.de.po"
#define TEST_MO_NAME   "translation_mo.de.mo"
#define REQUIRE_FORM_SIZE(x)

Functions

static std::string read_translation_file (const std::string &filename)
 TEST_CASE ("test translations")

Macro Definition Documentation

◆ CONTEXT

#define CONTEXT   L"context"

Referenced by TEST_CASE().

◆ REQUIRE_FORM_SIZE

#define REQUIRE_FORM_SIZE ( x)
Value:
{REQUIRE(form); REQUIRE(form.size() == (x));}
constexpr v3f x
Definition test_irr_matrix4.cpp:18

Referenced by TEST_CASE().

◆ TEST_MO_NAME

#define TEST_MO_NAME   "translation_mo.de.mo"

Referenced by TEST_CASE().

◆ TEST_PO_NAME

#define TEST_PO_NAME   "translation_po.de.po"

Referenced by TEST_CASE().

◆ TEXTDOMAIN_PO

#define TEXTDOMAIN_PO   L"translation_po"

Referenced by TEST_CASE().

Function Documentation

◆ read_translation_file()

std::string read_translation_file ( const std::string & filename)
static

References DIR_DELIM, findSubgame(), and fs::ReadFile().

Referenced by TEST_CASE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEST_CASE()

TEST_CASE ( "test translations" )

References CHECK, CONTEXT, Translations::getPluralTranslation(), Translations::getTranslation(), Translations::loadTranslation(), read_translation_file(), REQUIRE_FORM_SIZE, Translations::size(), TEST_MO_NAME, TEST_PO_NAME, and TEXTDOMAIN_PO.

Here is the call graph for this function: