Make lxqt globals a public header
[lxde/liblxqt.git] / lxqttranslator.h
1 /* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
4 * LXQt - a lightweight, Qt based, desktop toolset
5 * http://razor-qt.org
6 *
7 * Copyright: 2013 LXQt team
8 * Authors:
9 * Alexander Sokoloff <sokoloff.a@gmail.com>
10 Luís Pereira <luis.artur.pereira@gmail.com>
11 *
12 * This program or library is free software; you can redistribute it
13 * and/or modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21
22 * You should have received a copy of the GNU Lesser General
23 * Public License along with this library; if not, write to the
24 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301 USA
26 *
27 * END_COMMON_COPYRIGHT_HEADER */
28
29 #ifndef LXQTTRANSLATOR_H
30 #define LXQTTRANSLATOR_H
31
32 #include <QStringList>
33 #include "lxqtglobals.h"
34
35 namespace LXQt
36 {
37 /**
38 The Translator class provides internationalization support for application and librarioes.
39 **/
40 class LXQT_API Translator
41 {
42 public:
43 /**
44 Returns a list of paths that the application will search translations files.
45 **/
46 static QStringList translationSearchPaths();
47
48 /**
49 Sets the list of directories to search translations. All existing paths
50 will be deleted and the path list will consist of the paths given in paths.
51 **/
52 static void setTranslationSearchPaths(const QStringList &paths);
53
54 /**
55 Loads translations for application. If applicationName is not specified,
56 then basename of QCoreApplication::applicationFilePath() is used.
57 Returns true if the translation is successfully loaded; otherwise returns false.
58 **/
59 static bool translateApplication(const QString &applicationName = QString());
60
61 /**
62 Loads translations for application. If applicationName is not specified,
63 then basename of QCoreApplication::applicationFilePath() is used.
64 Returns true if the translation is successfully loaded; otherwise returns false.
65 **/
66 static bool translateLibrary(const QString &libraryName = QString());
67
68 static bool translatePlugin(const QString &pluginName, const QString& type);
69 };
70
71 } // namespace LXQt
72 #endif // LXQTTRANSLATOR_H