geigi/cozy

User interface not translated in flatpak build

swsnr opened this issue ยท 12 comments

swsnr commented

Bug/Feature description

When running with flatpak run --env=LANG=de_DE --env=LC_MESSAGES=de_DE com.github.geigi.cozy I do not see a translated user interface; instead all text is in English.

The locale data exists according to flatpak:

$ flatpak info com.github.geigi.cozy.Locale
            ID: com.github.geigi.cozy.Locale
           Ref: runtime/com.github.geigi.cozy.Locale/x86_64/stable
          Arch: x86_64
        Branch: stable
        Origin: flathub
    Collection: org.flathub.Stable
  Installation: system
     Installed: 49,7 kB

        Commit: 948667de6d82f734023a41bdce9bab463ea89529066f31d75e82569e6965d241
        Parent: ea7b9445a751aea29a746ce46cd177898ccc49e49ebcba10cd2c3d6c31e6d63e
       Subject: Bump version to 1.2.1 (959b9366)
          Date: 2022-08-21 13:05:58 +0000
Subdirectories: /de,/en

Steps to reproduce

Run flatpak run --env=LANG=de_DE --env=LC_MESSAGES=de_DE com.github.geigi.cozy

System Information

  • Operating System: Arch linux
  • Installation source: Flatpak
  • Version of cozy: 1.2.1 (flatpak 347e0b3c27b8e545f5a1c84b142f4f464645764413bce15f8edfbb353a93b1af commit)
geigi commented

Have you tried using de instead of de_DE?

swsnr commented

@geigi de is not a valid locale, so flatpak run --env=LANG=de --env=LC_MESSAGES=de com.github.geigi.cozy gives a Gtk warning right after start:

(com.github.geigi.cozy:2): Gtk-WARNING **: 08:58:47.556: Locale not supported by C library.
        Using the fallback 'C' locale.
['/app/bin/com.github.geigi.cozy']

The user interface remains English.

Perhaps Cozy is looking for locales in the wrong directory? I've had a similar issue recently with Zim, see zim-desktop-wiki/zim-desktop-wiki#2194

geigi commented

Ok might be a possibility. As far as I can remember the flatpak packaged Cozy adopted the system language correctly but maybe it broke.
Is your system language also German?

swsnr commented

Yes, it is. Other flatpaks (e.g. Zim with the above fix) have German text, and the language is also explicitly configured for flatpak:

$ flatpak config --system --list
languages: *unset* (default: de;en)
extra-languages: en;en_GB;de;de_DE

The locale is also installed correctly:

$ flatpak info com.github.geigi.cozy.Locale
            ID: com.github.geigi.cozy.Locale
           Ref: runtime/com.github.geigi.cozy.Locale/x86_64/stable
          Arch: x86_64
        Branch: stable
        Origin: flathub
    Collection: org.flathub.Stable
  Installation: system
     Installed: 49,7 kB

        Commit: 948667de6d82f734023a41bdce9bab463ea89529066f31d75e82569e6965d241
        Parent: ea7b9445a751aea29a746ce46cd177898ccc49e49ebcba10cd2c3d6c31e6d63e
       Subject: Bump version to 1.2.1 (959b9366)
          Date: 2022-08-21 13:05:58 +0000
Subdirectories: /de,/en

The locale data also exists in Cozy:

[๐Ÿ“ฆ com.github.geigi.cozy ~]$ find -L  /app/share/locale/ -name '*.mo'
/app/share/locale/de/LC_MESSAGES/com.github.geigi.cozy.mo
/app/share/locale/de/LC_MESSAGES/libdazzle-1.0.mo
/app/share/locale/de/LC_MESSAGES/libhandy.mo
/app/share/locale/en_GB/LC_MESSAGES/libhandy.mo
swsnr commented

@geigi I'd also like to point out that I'm familiar with Python and flatpak, so if you could point me to the place where Cozy sets up its locales I can also try to fiddle myself ๐Ÿ™‚

geigi commented

Cool! This should get you started:

gettext is initialized here

The locale_dir variable is set here (it gets inserted by meson)

Assembled path in meson

swsnr commented

I checked, and the locale directory is /app/share/locale. For reference, I tried a local build of Cozy (aur package), and turns out it doesn't have localized text either.

Either something's pretty wrong on my system (though all other apps have localized text), or there's some other issue in Cozy ๐Ÿค”

I sent a MR for this bug.

I think, installer is not installing any localizations.

installer log

There is no "Generating po" or "Installing po" entry in the log file.

Hi:
Both in version 1.2.1 of MX-Linux repos as .deb, as in the flatpak version it installs only in English and in the preferences there is no section to choose language....
Can it be solved in some way, since I see that the application is really translated.
Best regards

I installed v1.2.1 from ppa in Ubuntu 21 - cozy is english rather then my lang...