2024-06-29 19:24:28 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
|
|
// ES-DE Frontend
|
|
|
|
// LocalizationUtil.h
|
|
|
|
//
|
|
|
|
// Localization functions.
|
|
|
|
// Provides support for translations using gettext/libintl.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ES_CORE_UTILS_LOCALIZATION_UTIL_H
|
|
|
|
#define ES_CORE_UTILS_LOCALIZATION_UTIL_H
|
|
|
|
|
|
|
|
#include <libintl.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#define _(STR) std::string(gettext(STR))
|
|
|
|
|
|
|
|
namespace Utils
|
|
|
|
{
|
|
|
|
namespace Localization
|
|
|
|
{
|
2024-07-02 20:05:40 +00:00
|
|
|
static inline std::vector<std::pair<std::string, std::string>> sSupportedLocales {
|
|
|
|
{{"en"}, {"US"}}, {{"sv"}, {"SE"}}};
|
2024-06-29 19:24:28 +00:00
|
|
|
|
2024-07-02 20:05:40 +00:00
|
|
|
std::pair<std::string, std::string> getLocale();
|
2024-07-02 21:57:44 +00:00
|
|
|
void setLocale();
|
2024-06-29 19:24:28 +00:00
|
|
|
|
|
|
|
} // namespace Localization
|
|
|
|
|
|
|
|
} // namespace Utils
|
|
|
|
|
|
|
|
#endif // ES_CORE_UTILS_LOCALIZATION_UTIL_H
|