October 28, 2011

njduck njduck
Lab Rat
3 posts

Change the language of “QML Map Element”

 

I’m a Chinese.
I found that if I use an official offline OVI Map on my Nokia device.
The language of the map is Chinese.
But the Language is allways in English while I develop a soft base on QtQuick QML Map Element.

  1.         Map {
  2.             id: map
  3.             opacity: 1
  4.             anchors.fill: parent
  5.             size.width: parent.width
  6.             size.height: parent.height
  7.             zoomLevel: 10
  8.  
  9.             center: Coordinate {latitude: 39.90735; longitude: 116.39125}
  10.             connectivityMode: Map.OnlineMode
  11.             mapType: Map.StreetMap
  12.  
  13.             plugin: Plugin {name: "nokia"}
  14.        }

Is there any way to change the map language?
BTW, Is there any other value of the Plugin nameļ¼Ÿ

3 replies

October 28, 2011

cmer4 cmer4
Lab Rat
109 posts

njduck Nin Hao;)

I had the similar issue with Russian – so Russian turns on when your device’s locale is set to Russian. Could you try please your code ensuring your device is set to China locale?

October 28, 2011

njduck njduck
Lab Rat
3 posts
cmer4 wrote:
njduck Nin Hao;) I had the similar issue with Russian – so Russian turns on when your device’s locale is set to Russian. Could you try please your code ensuring your device is set to China locale?

3ks cmer4.
I’m not familiar with Nokia device.
Could u please tell me how to set the locale?
I have one Nokia C6-01 and one Nokia 5800w XpressMusic.

November 3, 2011

yangzl yangzl
Lab Rat
5 posts

i have set it ,but it always english.

  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3. #include <QLocale>
  4. #include <QSplashScreen>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.     QApplication a(argc, argv);
  9.     QSplashScreen *splash = new QSplashScreen;
  10.      splash->setPixmap(QPixmap(":/splash.png"));
  11.      splash->show();
  12.     splash->showMessage("Loaded modules");
  13. //    QLocale lo(QLocale::China, QLocale::Chinese);
  14.     QLocale::setDefault(QLocale(QLocale::Chinese, QLocale::China));
  15. //    QLocale::setDefault(&lo);
  16.     qDebug() << "china";
  17.     qDebug() << QLocale::system().language();
  18.     MainWindow w;
  19. #if defined(Q_OS_SYMBIAN) || defined(Q_OS_WINCE_WM) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
  20.   //  w.setControlsVisible(false);
  21.     w.showMaximized();
  22. #else
  23.     w.show();
  24.     qDebug() << "splash";
  25.     splash->showMessage("Established connections");
  26.         splash->finish(&w);
  27. #endif
  28.     return a.exec();
  29. }

[EDIT: code formatting, please wrap in @-tags, Volker]

 
  ‹‹ How use QSortFilterProxyModel with Model in QML      How to sort items in listview in qml ››

You must log in to post a reply. Not a member yet? Register here!