jtheoof / swappy

A Wayland native snapshot editing tool, inspired by Snappy on macOS
MIT License
1.05k stars 39 forks source link

Question about i18n #92

Closed maximbaz closed 3 years ago

maximbaz commented 3 years ago

Hey, just a quick question, I saw your commit https://github.com/jtheoof/swappy/commit/57c707a8ab7039f3f948ea1076e65f9a4a5f61d4 describing how to build i18n, and I want to make sure I'm doing everything correctly for your package once I moved it to Arch [community], but I never worked with i18n before - what is supposed to happen if I change ninja -C build to ninja -C build swappy-pot? Or in other words, how can I test that everything is good? I don't see any changes to the package, that's why I'm a bit confused 🤔

PKGBUILD is pretty much how you made it for AUR: https://github.com/archlinux/svntogit-community/blob/dbc2f1633d5abf5c112f17f03e12c1ec335259f4/trunk/PKGBUILD#L22-L23

jtheoof commented 3 years ago

Hi @maximbaz

The instructions in the README are only for maintainers of the app (developers/translators). The po files are built into mo files and installed at the ninja -C build install step.

You can see those here:

❯ yay -Ql swappy
...
swappy /usr/share/locale/
swappy /usr/share/locale/de/
swappy /usr/share/locale/de/LC_MESSAGES/
swappy /usr/share/locale/de/LC_MESSAGES/swappy.mo
swappy /usr/share/locale/en/
swappy /usr/share/locale/en/LC_MESSAGES/
swappy /usr/share/locale/en/LC_MESSAGES/swappy.mo
swappy /usr/share/locale/pt_BR/
swappy /usr/share/locale/pt_BR/LC_MESSAGES/
swappy /usr/share/locale/pt_BR/LC_MESSAGES/swappy.mo
swappy /usr/share/locale/tr/
swappy /usr/share/locale/tr/LC_MESSAGES/
swappy /usr/share/locale/tr/LC_MESSAGES/swappy.mo
...

I'm going to update the README a little to clarify.

That being said, I don't really know how to test those locales. I tried setting a different locale using localectl set-locale LANG=fr_FR.UTF-8 (with a fr translation of swappy that I have running locally) but the text is still displayed with en locale. Other apps, are displaying in fr locale properly so :thinking:

@brodi1 @xfgusta you've translated swappy in de and pt_BR. How did you test it? Is it working for you?

jtheoof commented 3 years ago

So I don't think it was working before (if it was I can't really explain how).

I've submitted #94 which now properly sets the domain for the app, before loading the glade UI file.

This will let the app know where the mo files are (they were already packaged on Arch, just not used).

I've tested the fr translation, it works ! :tada:

Once again, thanks @maximbaz for bringing it up ! And to answer your original question, you don't need to change anything to the PKGBUILD, the fix is purely on the application side.