Warning, file /education/khangman/src/langutils.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /************************************************************************ 0002 * Copyright 2007 Pino Toscano <pino@kde.org> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU General Public License as published by * 0006 * the Free Software Foundation; either version 2 of the License, or * 0007 * (at your option) any later version. * 0008 ************************************************************************/ 0009 0010 //project headers 0011 #include "langutils.h" 0012 0013 bool LangUtils::hasSpecialChars(const QString& lang) 0014 { 0015 if (lang == QLatin1String("en") 0016 || lang == QLatin1String("en_GB") 0017 || lang == QLatin1String("it") 0018 || lang == QLatin1String("nl") 0019 || lang == QLatin1String("ru") 0020 || lang == QLatin1String("bg") 0021 || lang == QLatin1String("uk") 0022 || lang == QLatin1String("el") 0023 || lang == QLatin1String("ro")) 0024 { 0025 return false; 0026 } 0027 return true; 0028 } 0029 0030 QFont LangUtils::fontForLanguage(const QString& lang) 0031 { 0032 QFont f; 0033 if (lang == QLatin1String("tg")) { 0034 f.setFamily( QStringLiteral("URW Bookman") ); 0035 } 0036 else { 0037 f.setFamily( QStringLiteral("Sans Serif") ); 0038 } 0039 return f; 0040 } 0041 0042 QString LangUtils::capitalize(const QString& str, const QString& lang) 0043 { 0044 // If German, make upper case, otherwise make lower case. 0045 QString ret; 0046 if (lang == QLatin1String("de")) { 0047 ret = str.toUpper(); 0048 } 0049 else { 0050 ret = str.toLower(); 0051 } 0052 return ret; 0053 } 0054 0055 // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on; 0056 // vim: set et sw=4 ts=4 cino=l1,cs,U1: 0057