1 /*
2  * This file is part of Kopete
3  *
4  * Copyright (C) 2009 Collabora Ltd. <info@collabora.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 
21 #include "dictionary.h"
22 
23 #include <KLocalizedString>
24 
25 Dictionary* Dictionary::s_self = nullptr;
26 
Dictionary()27 Dictionary::Dictionary()
28 {
29     // Set up the singleton instance
30     s_self = this;
31 
32     // Parameters
33     m_strings.insert(QLatin1String("password"), i18n("Password"));
34     m_strings.insert(QLatin1String("account"), i18n("Account"));
35     m_strings.insert(QLatin1String("priority"), i18n("Priority"));
36     m_strings.insert(QLatin1String("port"), i18n("Port"));
37     m_strings.insert(QLatin1String("alias"), i18n("Alias"));
38     m_strings.insert(QLatin1String("register"), i18n("Register new Account"));
39     m_strings.insert(QLatin1String("server"), i18n("Server Address"));
40     m_strings.insert(QLatin1String("fallback-stun-server"), i18n("Fallback STUN server address"));
41     m_strings.insert(QLatin1String("resource"), i18n("Resource"));
42     m_strings.insert(QLatin1String("https-proxy-port"), i18n("HTTPS Proxy Port"));
43     m_strings.insert(QLatin1String("require-encryption"), i18n("Require Encryption"));
44     m_strings.insert(QLatin1String("old-ssl"), i18n("Old-style SSL support"));
45     m_strings.insert(QLatin1String("fallback-stun-port"), i18n("Fallback STUN port"));
46     m_strings.insert(QLatin1String("fallback-conference-server"), i18n("Fallback Conference Server Address"));
47     m_strings.insert(QLatin1String("low-bandwidth"), i18n("Low Bandwidth Mode"));
48     m_strings.insert(QLatin1String("stun-server"), i18n("STUN Server Address"));
49     m_strings.insert(QLatin1String("stun-port"), i18n("STUN Port"));
50     m_strings.insert(QLatin1String("fallback-socks5-proxies"), i18n("Fallback SOCKS5 Proxy Addresses"));
51     m_strings.insert(QLatin1String("https-proxy-server"), i18n("HTTPS Proxy Server Address"));
52     m_strings.insert(QLatin1String("ignore-ssl-errors"), i18n("Ignore SSL Errors"));
53     m_strings.insert(QLatin1String("keepalive-interval"), i18n("Keepalive Interval"));
54 
55     // Protocols
56     m_strings.insert(QLatin1String("aim"), i18n("AOL Instant Messenger"));
57     m_strings.insert(QLatin1String("bigbrownchunx-skype-dbus"), i18n("Skype"));
58     m_strings.insert(QLatin1String("facebook"), i18n("Facebook Chat"));
59     m_strings.insert(QLatin1String("gadugadu"), i18n("Gadu-Gadu"));
60     m_strings.insert(QLatin1String("google-talk"), i18n("Google Talk"));
61     m_strings.insert(QLatin1String("groupwise"), i18n("Novell Groupwise"));
62     m_strings.insert(QLatin1String("icq"), i18n("ICQ"));
63     m_strings.insert(QLatin1String("skypeweb"), i18n("Skype"));
64     m_strings.insert(QLatin1String("irc"), i18n("Internet Relay Chat"));
65     m_strings.insert(QLatin1String("jabber"), i18n("Jabber/XMPP"));
66     m_strings.insert(QLatin1String("local-xmpp"), i18n("Bonjour/Salut"));
67     m_strings.insert(QLatin1String("mxit"), i18n("MXit"));
68     m_strings.insert(QLatin1String("msn"), i18n("Windows Live Messenger"));
69     m_strings.insert(QLatin1String("myspace"), i18n("MySpaceIM"));
70     m_strings.insert(QLatin1String("qq"), i18n("Tencent QQ"));
71     m_strings.insert(QLatin1String("sametime"), i18n("IBM Lotus Sametime"));
72     m_strings.insert(QLatin1String("silc"), i18n("SILC"));
73     m_strings.insert(QLatin1String("sip"), i18n("Session Initiation Protocol (SIP)"));
74     m_strings.insert(QLatin1String("tel"), i18n("GSM Telephony"));
75     m_strings.insert(QLatin1String("trepia"), i18n("Trepia"));
76     m_strings.insert(QLatin1String("yahoo"), i18n("Yahoo! Messenger"));
77     m_strings.insert(QLatin1String("yahoojp"), i18n("Yahoo! Messenger Japan"));
78     m_strings.insert(QLatin1String("zephyr"), i18n("Zephyr"));
79 }
80 
~Dictionary()81 Dictionary::~Dictionary()
82 {
83     // Delete the singleton instance of this class
84     s_self = nullptr;
85 }
86 
instance()87 Dictionary *Dictionary::instance()
88 {
89     // Construct the singleton if hasn't been already
90     if (!s_self) {
91         s_self = new Dictionary;
92     }
93 
94     // Return the singleton instance of this class
95     return s_self;
96 }
97 
string(const QString & key) const98 QString Dictionary::string(const QString &key) const
99 {
100     return m_strings.value(key);
101 }
102 
103