From b24e6433df3c3b2926568aff9c0173459e3e8eab Mon Sep 17 00:00:00 2001 From: Ekdohibs Date: Tue, 31 Jan 2017 18:05:03 +0100 Subject: Add clientside translations. --- src/translation.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/translation.h (limited to 'src/translation.h') diff --git a/src/translation.h b/src/translation.h new file mode 100644 index 000000000..18fc6c38f --- /dev/null +++ b/src/translation.h @@ -0,0 +1,42 @@ +/* +Minetest +Copyright (C) 2017 Nore, Nathanaƫl Courant + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#pragma once + +#include +#include + +class Translations; +extern Translations *g_translations; + +class Translations +{ +public: + Translations() = default; + + ~Translations(); + + void loadTranslation(const std::string &data); + void clear(); + const std::wstring &getTranslation( + const std::wstring &textdomain, const std::wstring &s); + +private: + std::unordered_map m_translations; +}; -- cgit v1.2.3