You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
938 B
C++
39 lines
938 B
C++
// SPDX-FileCopyrightText: 2026 Reion Wong <reionwong@gmail.com>
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
#include "base/i18n.h"
|
|
|
|
// The framework's own text, in its own catalog whatever the program's domain.
|
|
namespace cutefish::framework {
|
|
|
|
inline constexpr const char* kTranslationDomain = "cutefish-framework";
|
|
|
|
inline const char* translationDomain()
|
|
{
|
|
static const bool bound = (i18n::bindDomain(kTranslationDomain), true);
|
|
(void)bound;
|
|
return kTranslationDomain;
|
|
}
|
|
|
|
inline const char* tr(const char* text)
|
|
{
|
|
return i18n::dtr(translationDomain(), text);
|
|
}
|
|
|
|
inline const char* trc(const char* context, const char* text)
|
|
{
|
|
return i18n::dtrc(translationDomain(), context, text);
|
|
}
|
|
|
|
inline std::string trn(const char* singular, const char* plural, uint64_t n)
|
|
{
|
|
return i18n::dtrn(translationDomain(), singular, plural, n);
|
|
}
|
|
|
|
} // namespace cutefish::framework
|