1
/***************************************************************************
2
* Copyright (c) 2004 Werner Mayer <werner.wm.mayer@gmx.de> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
24
#ifndef GUI_TRANSLATOR_H
25
#define GUI_TRANSLATOR_H
28
# include <Gui/Qt4All.h>
37
typedef std::list<std::string> TStringList;
40
* The Translator class uses Qt's QTranslator objects to change the language of the application
42
* For more details see the \link i18n.html Internationalization with FreeCAD \endlink
45
* \author Werner Mayer
48
class GuiExport Translator : public QObject
53
/** @name singleton stuff */
55
/// Creates an instance
56
static Translator* instance(void);
57
/// Destroys the instance
58
static void destruct (void);
61
/** Activates the specified language \a lang if available. */
62
void activateLanguage (const char* lang);
63
/* Reloads the translators */
65
/** Returns the currently installed language. If no language is installed an empty string is returned. */
66
std::string activeLanguage() const;
67
/** Returns a list of supported languages. */
68
TStringList supportedLanguages() const;
69
/** Adds a path where localization files can be found */
70
void addPath(const QString& path);
75
void removeTranslators();
76
QStringList directories() const;
77
void installQMFiles(const QDir& dir, const char* locale);
80
static Translator* _pcSingleton;
86
#endif // GUI_TRANSLATOR_H