slint icon indicating copy to clipboard operation
slint copied to clipboard

Gettext feature for Android

Open FloVanGH opened this issue 1 year ago • 1 comments

At the moment it is not possible to build an Android app with Slint using the gettext feature for translation.

This is the error display on trying to build an Android Slint app with the gettext feature:

configure: error: Cannot find a type to use in place of socklen_t
  configure: error: /var/folders/f8/z6gqx68n093cnhkxzr7x7p_h0000gn/T/t1747-0/gettext/libtextstyle/configure failed for libtextstyle
  thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gettext-sys-0.21.3/build.rs:300:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Command `AR_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar CARGO_ENCODED_RUSTFLAGS=-Clink-arg=--target=aarch64-linux-android23\u{1f}-L\u{1f}/Users/user/Projects/project/target/cargo-apk-temp-extra-link-libraries CARGO_TARGET_AARCH64_LINUX_ANDROID_AR=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang CC_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang CFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXXFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXX_aarch64-linux-android=/opt/homebrew/share/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ cargo build --target aarch64-linux-android --package castle_of_focus --release` had a non-zero exit code.

FloVanGH avatar Aug 06 '24 08:08 FloVanGH

at some point, we'll have to support translation without gettext: https://github.com/slint-ui/slint/issues/3715

on the other hand, this issue there seems like a build error in the gettext-sys crate. probably related to cross compilation

ogoffart avatar Aug 06 '24 12:08 ogoffart

any news??

smir-ant avatar Oct 26 '25 12:10 smir-ant

There hasn’t been any progress on gettext support for Android. That said, you can use Slint‘s Translation bundling feature to translate your UI. Would that work for you?

tronical avatar Oct 27 '25 04:10 tronical

@tronical Yes, yes, yes, I'm sorry, I understood how it works. and it works great!

i don't need a gettext at all

smir-ant avatar Oct 27 '25 06:10 smir-ant