get rid of fallbackMgr in MultiLangMgr, fixes #4154

This commit is contained in:
heckflosse
2017-10-20 21:05:19 +02:00
parent 41cd29d201
commit 8c328cafd1
3 changed files with 34 additions and 50 deletions

View File

@@ -20,8 +20,8 @@
#define _MULTILANGMGR_
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <glibmm/ustring.h>
@@ -29,22 +29,14 @@ class MultiLangMgr
{
public:
MultiLangMgr ();
MultiLangMgr (const Glib::ustring& fname, MultiLangMgr* fallbackMgr = nullptr);
public:
bool load (const Glib::ustring& fname, MultiLangMgr* fallbackMgr = nullptr);
public:
Glib::ustring getStr (const std::string& key) const;
public:
static bool isOSLanguageDetectSupported ();
static Glib::ustring getOSUserLanguage ();
void load(const std::vector<Glib::ustring> &fnames);
Glib::ustring getStr(const std::string& key) const;
static bool isOSLanguageDetectSupported();
static Glib::ustring getOSUserLanguage();
private:
std::map<std::string, Glib::ustring> translations;
std::unique_ptr<MultiLangMgr> fallbackMgr;
};
extern MultiLangMgr langMgr;