grantleecontactutils.cpp 3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
/*
  Copyright (c) 2013-2015 Montel Laurent <montel@kde.org>

  This program is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License, version 2, as
  published by the Free Software Foundation.

  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include "grantleecontactutils.h"

#include <KLocalizedString>
using namespace KAddressBookGrantlee;

GrantleeContactUtils::GrantleeContactUtils()
{

}

void GrantleeContactUtils::insertVariableToQVariantHash(QVariantHash &contactI18n, const QString &variable)
{
    contactI18n.insert(variable, variableI18n(variable));
}

QString GrantleeContactUtils::variableI18n(const QString &variable)
{
    if (variable == QLatin1String("birthdayi18n")) {
        return i18n("Birthday");
    } else if (variable == QLatin1String("anniversaryi18n")) {
        return i18nc("The wedding anniversary of a contact", "Anniversary");
    } else if (variable == QLatin1String("emailsi18n")) {
        return i18n("Emails");
    } else if (variable == QLatin1String("websitei18n")) {
        return i18n("Website");
    } else if (variable == QLatin1String("blogUrli18n")) {
        return i18n("Blog Feed");
    } else if (variable == QLatin1String("addressBookNamei18n")) {
        return i18n("Address Book");
    } else if (variable == QLatin1String("notei18n")) {
        return i18n("Note");
    } else if (variable == QLatin1String("departmenti18n")) {
        return i18n("Department");
    } else if (variable == QLatin1String("Professioni18n")) {
        return i18n("Profession");
    } else if (variable == QLatin1String("officei18n")) {
        return i18n("Office");
    } else if (variable == QLatin1String("manageri18n")) {
        return i18n("Manager's Name");
    } else if (variable == QLatin1String("assistanti18n")) {
        return i18n("Assistant's Name");
    } else if (variable == QLatin1String("spousei18n")) {
        return i18n("Partner's Name");
    } else if (variable == QLatin1String("imAddressi18n")) {
        return i18n("IM Address");
    } else if (variable == QLatin1String("latitudei18n")) {
        return i18n("Latitude");
    } else if (variable == QLatin1String("longitudei18n")) {
        return i18n("Longitude");
    } else if (variable == QLatin1String("organizationi18n")) {
        return i18n("Organization");
    } else if (variable == QLatin1String("namei18n")) {
        return i18n("Name");
    } else if (variable == QLatin1String("titlei18n")) {
        return i18n("Title");
    } else if (variable == QLatin1String("nextcontacti18n")) {
        return i18n("Contact");
    } else {
        return variable;
    }
}