summaryrefslogtreecommitdiff
path: root/navit/android.c
diff options
context:
space:
mode:
authorzoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-02-20 19:34:34 +0000
committerzoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-02-20 19:34:34 +0000
commiteff8e66eacef6fcdb0275f73068409dbea8ccfae (patch)
tree0a74ed363af93d9ca4dee52e320aaa0c2ebb5b1d /navit/android.c
parent687f5dc8e180c378c3ce8ca8de9374fb98870e78 (diff)
downloadnavit-eff8e66eacef6fcdb0275f73068409dbea8ccfae.tar.gz
Add:Android:get localized strings
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4225 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/android.c')
-rw-r--r--navit/android.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/navit/android.c b/navit/android.c
index 8bb0f42cf..64147784e 100644
--- a/navit/android.c
+++ b/navit/android.c
@@ -254,6 +254,27 @@ Java_org_navitproject_navit_NavitSensors_SensorCallback( JNIEnv* env, jobject th
callback_call_4((struct callback *)id, sensor, &x, &y, &z);
}
+
+JNIEXPORT jstring JNICALL
+Java_org_navitproject_navit_NavitGraphics_CallbackLocalizedString( JNIEnv* env, jobject thiz, jobject str)
+{
+ const char *s;
+ const char *localized_str;
+
+ s=(*env)->GetStringUTFChars(env, str, NULL);
+ dbg(0,"*****string=%s\n",s);
+
+ localized_str=gettext(s);
+ dbg(0,"localized string=%s",localized_str);
+
+ // jstring dataStringValue = (jstring) localized_str;
+ jstring js = (*env)->NewStringUTF(env,localized_str);
+
+ (*env)->ReleaseStringUTFChars(env, str, s);
+
+ return js;
+}
+
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, jobject thiz, int i, jobject str)
{