From 22c54adb58886c3e6d611be225814d8a08d8e098 Mon Sep 17 00:00:00 2001 From: ShaopengLin Date: Sat, 3 Aug 2024 04:21:55 -0400 Subject: [PATCH] Expose i18n translation API to tools.h --- include/tools.h | 9 +++++++++ src/server/i18n.h | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/tools.h b/include/tools.h index 13931e876..511a94070 100644 --- a/include/tools.h +++ b/include/tools.h @@ -282,5 +282,14 @@ FeedCategories readCategoriesFromFeed(const std::string& content); * @return full language name. */ std::string getLanguageSelfName(const std::string& lang); + +/** + * Retrieve the translation corresponding to key in language lang + * + * @param lang ISO 639-3 language code. + * @param key translation key string + * @return translated key + */ +std::string getTranslatedString(const std::string& lang, const std::string& key); } #endif // KIWIX_TOOLS_H diff --git a/src/server/i18n.h b/src/server/i18n.h index 1e42cac68..e20f425f9 100644 --- a/src/server/i18n.h +++ b/src/server/i18n.h @@ -20,6 +20,7 @@ #ifndef KIWIX_SERVER_I18N #define KIWIX_SERVER_I18N +#include #include #include #include @@ -40,8 +41,6 @@ struct I18nStringTable { const char* get(const std::string& key) const; }; -std::string getTranslatedString(const std::string& lang, const std::string& key); - namespace i18n {