diff options
author | Ekdohibs <nathanael.courant@laposte.net> | 2017-01-31 18:05:03 +0100 |
---|---|---|
committer | Ekdohibs <nathanael.courant@laposte.net> | 2017-08-24 17:54:10 +0200 |
commit | b24e6433df3c3b2926568aff9c0173459e3e8eab (patch) | |
tree | eec6a9f05e78e3de7b08c805685cd54dcc5e43de /src/translation.h | |
parent | b28af0ed0777f66122ecaf0d0e302fe24c88d552 (diff) | |
download | minetest-b24e6433df3c3b2926568aff9c0173459e3e8eab.tar.gz minetest-b24e6433df3c3b2926568aff9c0173459e3e8eab.tar.bz2 minetest-b24e6433df3c3b2926568aff9c0173459e3e8eab.zip |
Add clientside translations.
Diffstat (limited to 'src/translation.h')
-rw-r--r-- | src/translation.h | 42 |
1 files changed, 42 insertions, 0 deletions
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 <nore@mesecons.net> + +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 <unordered_map> +#include <string> + +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<std::wstring, std::wstring> m_translations; +}; |