From 28e0f2afaa03a0bf402b2a7ba70c8dbb81659c32 Mon Sep 17 00:00:00 2001 From: rachytski Date: Mon, 6 Feb 2012 18:55:24 +0400 Subject: [PATCH] [android] added "Empty Model" message localization. --- android/jni/com/mapswithme/maps/Framework.cpp | 8 ++++++++ android/jni/com/mapswithme/maps/Framework.hpp | 2 ++ android/jni/com/mapswithme/maps/MWMActivity.cpp | 1 + android/res/values-de/strings.xml | 1 + android/res/values-es/strings.xml | 1 + android/res/values-fr/strings.xml | 1 + android/res/values-ru/strings.xml | 1 + android/res/values/strings.xml | 1 + android/src/com/mapswithme/maps/MWMActivity.java | 15 +++++++++++---- map/framework.cpp | 7 +++---- 10 files changed, 30 insertions(+), 8 deletions(-) diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 6b1991ba51..54062f470e 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -2,7 +2,9 @@ #include "VideoTimer.hpp" #include "../core/jni_helper.hpp" +#include "../core/jni_string.hpp" #include "../core/render_context.hpp" +#include "../jni/jni_thread.hpp" #include "../../../../../indexer/drawing_rules.hpp" @@ -46,6 +48,12 @@ namespace android m_work.Storage().ReInitCountries(false); } + void Framework::SetEmptyModelMessage(jstring s) + { + std::string emptyModelMsg = jni::ToString(jni::GetCurrentThreadJNIEnv(), s); + m_work.GetInformationDisplay().setEmptyModelMessage(emptyModelMsg.c_str()); + } + Framework::~Framework() { delete m_videoTimer; diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index ea6f825300..33e9346574 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -39,6 +39,8 @@ namespace android Framework(JavaVM * jvm); ~Framework(); + void SetEmptyModelMessage(jstring emptyModelMsg); + storage::Storage & Storage(); void OnLocationStatusChanged(int/* == location::TLocationStatus*/ newStatus); diff --git a/android/jni/com/mapswithme/maps/MWMActivity.cpp b/android/jni/com/mapswithme/maps/MWMActivity.cpp index cb498207f4..6dc880b1e2 100644 --- a/android/jni/com/mapswithme/maps/MWMActivity.cpp +++ b/android/jni/com/mapswithme/maps/MWMActivity.cpp @@ -62,6 +62,7 @@ extern "C" g_framework = new android::Framework(g_jvm); } + g_framework->SetEmptyModelMessage(emptyModelMessage); } //////////////////////////////////////////////////////////////////////////////////////////// diff --git a/android/res/values-de/strings.xml b/android/res/values-de/strings.xml index 81c701bbd0..f8b0e92ed4 100644 --- a/android/res/values-de/strings.xml +++ b/android/res/values-de/strings.xml @@ -20,4 +20,5 @@ Meilen Kilometer Schließen + Um die Karte dieses Ortes\nherunterzuladen, berühren Sie\n bitte die Taste in der unteren\n Hälfte des Bildschirms diff --git a/android/res/values-es/strings.xml b/android/res/values-es/strings.xml index 32f4128c49..ef6625da5a 100644 --- a/android/res/values-es/strings.xml +++ b/android/res/values-es/strings.xml @@ -20,4 +20,5 @@ Milla Kilómetros Cerrar + Para poder ver detalles\n de esta zona debes descargar\nel mapa de este país. Pulse el botón\nbajo la pantalla para descargar. diff --git a/android/res/values-fr/strings.xml b/android/res/values-fr/strings.xml index 05712f2443..efd3d34796 100644 --- a/android/res/values-fr/strings.xml +++ b/android/res/values-fr/strings.xml @@ -20,4 +20,5 @@ Milles Kilomètres Fermer + Pour scharger cette carte,\ntoucher le bouton au bas de l`écran diff --git a/android/res/values-ru/strings.xml b/android/res/values-ru/strings.xml index 58289b74be..8920eae6fe 100644 --- a/android/res/values-ru/strings.xml +++ b/android/res/values-ru/strings.xml @@ -24,4 +24,5 @@ Закрыть Загруженные карты недоступны Отключите USB кабель или вставьте SD-карту + Чтобы загрузить карту\nэтого места, нажмите на\nкнопку загрузки внизу экрана diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 4a67d775ca..ae3616b209 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -24,4 +24,5 @@ Close External storage memory is not available Please disconnect USB cable or insert memory card to use MapsWithMe + Nothing found. Have you tried\ndownloading maps of the countries?\nJust click the download button\nat the bottom of the screen. diff --git a/android/src/com/mapswithme/maps/MWMActivity.java b/android/src/com/mapswithme/maps/MWMActivity.java index 10cfa1fbd9..158f32fb8e 100644 --- a/android/src/com/mapswithme/maps/MWMActivity.java +++ b/android/src/com/mapswithme/maps/MWMActivity.java @@ -177,7 +177,8 @@ public class MWMActivity extends NvEventQueueActivity implements extStoragePath, getTmpPath(), extTmpPath, - getSettingsPath()); + getSettingsPath(), + getString(R.string.empty_model)); checkMeasurementSystem(); @@ -375,9 +376,15 @@ public class MWMActivity extends NvEventQueueActivity implements private native void nativeStorageConnected(); private native void nativeStorageDisconnected(); - private native void nativeInit(int densityDpi, int screenWidth, int screenHeight, - String apkPath, - String storagePath, String tmpPath, String extTmpPath, String settingsPath); + private native void nativeInit(int densityDpi, + int screenWidth, + int screenHeight, + String apkPath, + String storagePath, + String tmpPath, + String extTmpPath, + String settingsPath, + String emptyModelMessage); private native void nativeDestroy(); private native void nativeLocationStatusChanged(int newStatus); private native void nativeLocationUpdated(long time, double lat, double lon, float accuracy); diff --git a/map/framework.cpp b/map/framework.cpp index cde882db52..642ef3b236 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -123,10 +123,6 @@ Framework::Framework() m_informationDisplay.enableRuler(true); m_informationDisplay.setRulerParams(m_minRulerWidth, m_metresMinWidth, m_metresMaxWidth); - double const visScale = GetPlatform().VisualScale(); - m_navigator.SetMinScreenParams( - static_cast(m_minRulerWidth * visScale), m_metresMinWidth); - #ifndef OMIM_PRODUCTION m_informationDisplay.enableDebugInfo(true); #endif @@ -720,6 +716,9 @@ void Framework::SetRenderPolicy(RenderPolicy * renderPolicy) m_informationDisplay.enableLog(isVisualLogEnabled, renderPolicy->GetWindowHandle().get()); m_informationDisplay.setVisualScale(GetPlatform().VisualScale()); + m_navigator.SetMinScreenParams(static_cast(m_minRulerWidth * GetPlatform().VisualScale()), + m_metresMinWidth); + yg::gl::RenderContext::initParams(); }