Doesnt work as expected on windows
Hi, Ive build it on Windows with msvc (in a vm) and I can do the following:
PS C:\Users\Windoofer\Desktop\rpg> $env:TEXTDOMAINDIR="res/locale"
PS C:\Users\Windoofer\Desktop\rpg> gettext.exe -d app app-name
Berichtshefte Generator
But the translations with gettext lib only return the translation key. the exact same code works just fine under linux.
Is there anything that i can do to debug where the problem in gettext-rs /gettext-sys lies?
Ive build it on Windows with msvc (in a vm)
That's super cool! Would you be able to help with #12? Like, describe the environment (what you had to install onto a fresh Windows) and the steps (the commands you ran to build it)? Or maybe even turning it into a CI config? :)
As for the problem at hand, I'd start with crates' test suites. What does cargo test --package gettext-sys say? What about cargo test --package gettext-rs?
gonna give you the the commands i ran in the vm tommorow
Live is full rn, I bookmarked this, going to get back to it when I have some time again, sry
Interresting, I can't even reproduce the manual usage of gettext in powersehll in a Windows vm anymore..
Going to have to do more debugging.
Right now I'm using msys2 gettext which works fine, but I will have to drop msyw2, because its dlls for gtk won't work when outside, because they use / for svg resolution.
So yea, I'm going to have to switch to gvsbuild, and it might be that their gettext was acting different.
I'm going to come back here and report the results of my findings. Also going to try gettext from gnu-win32 and see how it behaves
I actually just compiled with gvsbuild + cargo-xwin
exe: (check "llvm-ar") (check "cargo-xwin") (check "unzip") gvs
#!/usr/bin/env sh
rm -rf tmp
mkdir -p tmp
unzip gvs.zip -d tmp/gvs
LIBS="tmp/gvs-vulkan"
DIST="tmp/dist"
cp -r tmp/gvs $LIBS
llvm-ar crv $LIBS/lib/vulkan.lib
llvm-ar crv $LIBS/lib/vulkan-1.lib
PKG_CONFIG_ALLOW_CROSS=1 \
Lib="$LIBS/lib" \
PATH="$LIBS/bin:$PATH" \
PKG_CONFIG_PATH="$LIBS/pkgconfig" \
GETTEXT_DIR="$LIBS" \
cargo-xwin build \
--target x86_64-pc-windows-msvc \
--release
mkdir -p $DIST
mv tmp/gvs $DIST/gvs
cp target/x86_64-pc-windows-msvc/release/report-book-generator.exe $DIST/rpg.exe
cp -r res $DIST/res
cat > tmp/start.bat << 'EOF'
@echo off
set GVS=%~dp0gvs
set PATH=%GVS%\bin;%PATH%
set PKG_CONFIG_PATH=%GVS%\lib\pkgconfig
set LIB=%GVS%\lib;%LIB%
set INCLUDE=%GVS%\include;%INCLUDE%
set LANG=de
"%~dp0rpg.exe"
EOF
gvs: (check "wget")
[ -f gvs.zip ] || wget -q -O gvs.zip https://github.com
and im running into the same problem. again.
The lookup doesnt seem to work on windows
I really have no idea why it doesn't work, but here's a couple suggestions:
- instead of relying on the environment variable, hard-code the path into the
bindtextdomaincall and see if that works - I bet Windows has something similar to
strace— a tool that shows the system calls that a program makes. Try running your program with that tool and see what directories it scans; that might give us more ideas.