diff options
author | Pevernow <3450354617@qq.com> | 2021-08-09 00:59:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 18:59:07 +0200 |
commit | c6eddb0bae32c43ffff46e9c1e3f293d0fd9ed73 (patch) | |
tree | c8cfd861330d8be7970ed67ae4e70d92b703e3f5 /android | |
parent | 4a3728d828fa8896b49e80fdc68f5d7647bf45b7 (diff) | |
download | minetest-c6eddb0bae32c43ffff46e9c1e3f293d0fd9ed73.tar.gz minetest-c6eddb0bae32c43ffff46e9c1e3f293d0fd9ed73.tar.bz2 minetest-c6eddb0bae32c43ffff46e9c1e3f293d0fd9ed73.zip |
Gettext support on Android (#11435)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: =?UTF-8?q?Olivier=20Samyn=20=F0=9F=8E=BB?= <code@oleastre.be>
Diffstat (limited to 'android')
-rw-r--r-- | android/app/build.gradle | 11 | ||||
-rw-r--r-- | android/native/jni/Android.mk | 9 |
2 files changed, 15 insertions, 5 deletions
diff --git a/android/app/build.gradle b/android/app/build.gradle index b7d93ef0f..53fe85910 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -76,10 +76,13 @@ task prepareAssets() { copy { from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}" } - /*copy { - // ToDo: fix broken locales - from "${projRoot}/po" into "${assetsFolder}/po" - }*/ + fileTree("${projRoot}/po").include("**/*.po").forEach { poFile -> + def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/" + file(moPath).mkdirs() + exec { + commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile + } + } copy { from "${projRoot}/textures" into "${assetsFolder}/textures" } diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index 5039f325e..f92ac1d60 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -48,6 +48,11 @@ LOCAL_SRC_FILES := deps/Android/OpenAL-Soft/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/ include $(PREBUILT_STATIC_LIBRARY) include $(CLEAR_VARS) +LOCAL_MODULE := GetText +LOCAL_SRC_FILES := deps/Android/GetText/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libintl.a +include $(PREBUILT_STATIC_LIBRARY) + +include $(CLEAR_VARS) LOCAL_MODULE := Vorbis LOCAL_SRC_FILES := deps/Android/Vorbis/${NDK_TOOLCHAIN_VERSION}/$(APP_ABI)/libvorbis.a include $(PREBUILT_STATIC_LIBRARY) @@ -64,6 +69,7 @@ LOCAL_CFLAGS += \ -DUSE_FREETYPE=1 \ -DUSE_LEVELDB=0 \ -DUSE_LUAJIT=1 \ + -DUSE_GETTEXT=1 \ -DVERSION_MAJOR=${versionMajor} \ -DVERSION_MINOR=${versionMinor} \ -DVERSION_PATCH=${versionPatch} \ @@ -89,6 +95,7 @@ LOCAL_C_INCLUDES := \ deps/Android/Freetype/include \ deps/Android/Irrlicht/include \ deps/Android/LevelDB/include \ + deps/Android/GetText/include \ deps/Android/libiconv/include \ deps/Android/libiconv/libcharset/include \ deps/Android/LuaJIT/src \ @@ -194,7 +201,7 @@ LOCAL_SRC_FILES += \ # SQLite3 LOCAL_SRC_FILES += deps/Android/sqlite/sqlite3.c -LOCAL_STATIC_LIBRARIES += Curl Freetype Irrlicht OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT android_native_app_glue $(PROFILER_LIBS) #LevelDB +LOCAL_STATIC_LIBRARIES += Curl Freetype Irrlicht OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT GetText android_native_app_glue $(PROFILER_LIBS) #LevelDB LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES |