Settings: unify duplicated code
[lxde/liblxqt.git] / lxqttranslator.h
CommitLineData
949dba2f
AS
1/* BEGIN_COMMON_COPYRIGHT_HEADER
2 * (c)LGPL2+
3 *
b9223fe7 4 * LXQt - a lightweight, Qt based, desktop toolset
949dba2f
AS
5 * http://razor-qt.org
6 *
b9223fe7 7 * Copyright: 2013 LXQt team
949dba2f
AS
8 * Authors:
9 * Alexander Sokoloff <sokoloff.a@gmail.com>
f6741c93 10 Luís Pereira <luis.artur.pereira@gmail.com>
949dba2f
AS
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>
f9cba1ba 33#include "lxqtglobals.h"
949dba2f 34
f05ba5af 35namespace LXQt
949dba2f
AS
36{
37/**
38 The Translator class provides internationalization support for application and librarioes.
39 **/
f9cba1ba 40class LXQT_API Translator
949dba2f
AS
41{
42public:
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 **/
3862cd68 59 static bool translateApplication(const QString &applicationName = QString());
949dba2f
AS
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 **/
3862cd68 66 static bool translateLibrary(const QString &libraryName = QString());
949dba2f 67
12dc4c95 68 static bool translatePlugin(const QString &pluginName, const QString& type);
949dba2f
AS
69};
70
f05ba5af 71} // namespace LXQt
949dba2f 72#endif // LXQTTRANSLATOR_H