diff options
author | zoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-20 19:34:34 +0000 |
---|---|---|
committer | zoff99 <zoff99@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-02-20 19:34:34 +0000 |
commit | eff8e66eacef6fcdb0275f73068409dbea8ccfae (patch) | |
tree | 0a74ed363af93d9ca4dee52e320aaa0c2ebb5b1d /navit/android.c | |
parent | 687f5dc8e180c378c3ce8ca8de9374fb98870e78 (diff) | |
download | navit-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.c | 21 |
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) { |