|
|
/*************************************************************************** * * File: MLang.h * Created: Tue Dec 14 1999 * (C) 1999 by David M. <captjay@superlink.net> * ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef MLANG_H #define MLANG_H #include <qobject.h> #include <qdict.h> #include "CustomException.h" /** * @author David M. * @short Handles displayable strings in multiple languages * * The MLang class provides basic internationalization capabilities. * it uses a file that keeps displayable strings indexed by a string identifier. * */ class MLang : public QObject { public: ~MLang(); QString currentLanguage() const; bool setLanguage(const QString lang); const QString get(const char* key) const; static MLang* instance(); static void init(); private: MLang(); QString _lang; QDict<QString>* _strings; static MLang* _instance; }; extern MLang* gML; class EBadLangFileError: public CustomException { Q_OBJECT public: EBadLangFileError(QString message); }; class EStringNotFoundError: public CustomException { Q_OBJECT public: EStringNotFoundError(QString message); }; #endif
Generated by: nightsky@centauri on Sat Jan 15 23:06:10 2000, using kdoc 2.0a30. |