1
/***************************************************************************
3
* (C) 2008-2010 by Eric MAEKER, MD *
4
* eric.maeker@free.fr *
5
* All rights reserved. *
7
* This program is a free and open source software. *
8
* It is released under the terms of the new BSD License. *
10
* Redistribution and use in source and binary forms, with or without *
11
* modification, are permitted provided that the following conditions *
13
* - Redistributions of source code must retain the above copyright *
14
* notice, this list of conditions and the following disclaimer. *
15
* - Redistributions in binary form must reproduce the above copyright *
16
* notice, this list of conditions and the following disclaimer in the *
17
* documentation and/or other materials provided with the distribution. *
18
* - Neither the name of the FreeMedForms' organization nor the names of *
19
* its contributors may be used to endorse or promote products derived *
20
* from this software without specific prior written permission. *
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
25
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
26
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
27
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
28
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
29
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
30
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
32
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
33
* POSSIBILITY OF SUCH DAMAGE. *
34
***************************************************************************/
35
/***************************************************************************
36
* Main Developper : Eric MAEKER, <eric.maeker@free.fr> *
38
* NAME <MAIL@ADRESS> *
39
***************************************************************************/
40
#ifndef TKTRANSLATORS_H
41
#define TKTRANSLATORS_H
45
#include <coreplugin/core_exporter.h>
50
* \file itranslators.h
51
* \author Eric MAEKER <eric.maeker@free.fr>
58
class CORE_EXPORT ITranslators : public QObject
62
static tkTranslators* instance( QObject * parent = 0) ;
65
bool addNewTranslator( const QString & fileName, bool fromDefaultPath = true );
66
bool addNewTranslator( const QString & path, const QString & file );
69
void changeLanguage( const QString & lang );
72
static bool setPathToTranslations( const QString & path );
73
static QString pathToTranslations();
75
static QStringList availableLocales();
76
static QStringList availableLanguages();
77
static QMap<QString, QString> availableLocalesAndLanguages();
80
void languageChanged();
83
tkTranslators( QObject * parent = 0 );
86
QMap<QString, QTranslator*> m_Translators; // String is file location and mask
87
static QString m_PathToTranslations;
88
static tkTranslators *m_Instance;