1 /* |
1 /* |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
4 * |
9 * Initial Contributors: |
5 * This program is free software: you can redistribute it and/or modify |
10 * Nokia Corporation - initial contribution. |
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
11 * |
8 * |
12 * Contributors: |
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
13 * |
13 * |
14 * Description: |
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
15 * |
19 * |
16 */ |
20 */ |
17 |
|
18 |
21 |
19 #include <QString> |
22 #include <QString> |
20 #include "LocaleDelegate.h" |
23 #include "LocaleDelegate.h" |
21 |
24 |
22 #include <qdebug.h> |
25 #include <QDebug> |
23 |
26 |
24 const QString JS_PREFIX = "txt_browser_"; |
|
25 namespace GVA { |
27 namespace GVA { |
26 LocaleDelegate::LocaleDelegate(ChromeWidget* chrome) |
28 LocaleDelegate::LocaleDelegate(ChromeWidget* chrome) |
27 { |
29 { |
28 setObjectName("localeDelegate"); |
30 setObjectName("localeDelegate"); |
29 } |
31 } |
30 |
32 |
31 LocaleDelegate::~LocaleDelegate() |
33 LocaleDelegate::~LocaleDelegate() |
32 { |
34 { |
33 } |
35 } |
34 |
36 |
35 /* |
37 /* |
36 * Load the localized string based on the string id |
38 * Load the localized string based on the string id |
37 */ |
39 */ |
38 QString LocaleDelegate::translateText(const QString & textToTranlsate) |
40 QString LocaleDelegate::translateText(const QString & textToTranlsate) |
39 { |
41 { |
40 QString ret = qtTrId((JS_PREFIX + textToTranlsate).toLatin1()); |
42 QString ret = qtTrId(textToTranlsate.toLatin1()); |
41 //qDebug() << "LocaleDelegate::translateText " << ret; |
43 //qDebug() << "LocaleDelegate::translateText " << ret; |
42 return ret; |
44 return ret; |
43 } |
45 } |
44 } // endof namespace GVA |
46 } // endof namespace GVA |