Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about i18n #92

Closed
maximbaz opened this issue Feb 20, 2021 · 2 comments · Fixed by #94
Closed

Question about i18n #92

maximbaz opened this issue Feb 20, 2021 · 2 comments · Fixed by #94

Comments

@maximbaz
Copy link

Hey, just a quick question, I saw your commit 57c707a 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
Copy link
Owner

jtheoof commented Feb 21, 2021

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 🤔

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

jtheoof added a commit that referenced this issue Feb 21, 2021
Most of the `i18n` boilerplate was there, but the app still needed to
know what domain to look for. This must happen after initialization of
the `GtkBuilder` and before loading the glade file.

The domain is simply the `mo` file packaged with the app and usually
located under:

```

```
/usr/share/locale/$LANG/LC_MESSAGES/$APP.mo
```

Once again thanks to @maximbaz for pointing it out.

Closes #92
jtheoof added a commit that referenced this issue Feb 21, 2021
Most of the `i18n` boilerplate was there, but the app still needed to
know what domain to look for. This must happen after initialization of
the `GtkBuilder` and before loading the glade file.

The domain is simply the `mo` file packaged with the app and usually
located under:

```
/usr/share/locale/$LANG/LC_MESSAGES/$APP.mo
```

Once again thanks to @maximbaz for pointing it out.

Closes #92
@jtheoof
Copy link
Owner

jtheoof commented Feb 21, 2021

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 ! 🎉

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.

jtheoof added a commit that referenced this issue Feb 21, 2021
Most of the `i18n` boilerplate was there, but the app still needed to
know what domain to look for. This must happen after initialization of
the `GtkBuilder` and before loading the glade file.

The domain is simply the `mo` file packaged with the app and usually
located under:

```
/usr/share/locale/$LANG/LC_MESSAGES/$APP.mo
```

Once again thanks to @maximbaz for pointing it out.

Closes #92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants