summaryrefslogtreecommitdiffstats
path: root/core/gettextfromc.cpp
blob: fdb1e6d37af1f4d2c1cc5ff4bd63a7aa99486c10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// SPDX-License-Identifier: GPL-2.0
#include "gettextfromc.h"
#include <QHash>

static QHash<QByteArray, QByteArray> translationCache;

extern "C" const char *trGettext(const char *text)
{
	QByteArray &result = translationCache[QByteArray(text)];
	if (result.isEmpty())
		result = gettextFromC::tr(text).toUtf8();
	return result.constData();
}