languagesupport.h

Go to the documentation of this file.
00001 /****************************************************************
00002  *  Vidalia is distributed under the following license:
00003  *
00004  *  Copyright (C) 2006,  Matt Edman, Justin Hipple
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; either version 2
00009  *  of the License, or (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00019  *  Boston, MA  02110-1301, USA.
00020  ****************************************************************/
00021 
00022 /** 
00023  * \file languagesupport.h
00024  * \version $Id: languagesupport.h 1238 2006-09-25 17:50:57Z edmanm $
00025  * \brief Contains languages supported by Vidalia
00026  */
00027 
00028 #ifndef _LANGUAGESUPPORT_H
00029 #define _LANGUAGESUPPORT_H
00030 
00031 #include <QApplication>
00032 #include <QStringList>
00033 #include <QMap>
00034 
00035 
00036 class LanguageSupport
00037 {
00038 public:
00039   /** Returns the default language code for the system locale. */
00040   static QString defaultLanguageCode();
00041   /** Returns the language code for a given language name. */
00042   static QString languageCode(QString languageName);
00043   /** Returns a list of all supported language codes (e.g., "en"). */
00044   static QStringList languageCodes();
00045   /** Returns the language name for a given language code. */
00046   static QString languageName(QString languageCode);
00047   /** Returns a list of all supported language names (e.g., "English"). */
00048   static QStringList languageNames();
00049   /** Returns a list of all supported language codes and names. */
00050   static QMap<QString, QString> languages();
00051   /** Returns true if we understand the given language code. */
00052   static bool isValidLanguageCode(QString code);
00053   /** Sets the application's translator to the specified language. */
00054   static bool translate(QString langCode);
00055 };
00056 
00057 #endif
00058 

Generated on Mon Oct 23 20:08:16 2006 for Vidalia by  doxygen 1.5.0