packaging: translate the desktop entries to Russian - #1739
Conversation
|
It's a good idea, but need to refactor/think how it should be done. Adding 1 language is simple, but adding 15 will bloat the pkgbuild files. |
The launcher entry, its Flatpak actions and the notification service entry were written inline in PKGBUILD, PKGBUILD-git and PKGBUILD-bin, so every localized line would have had to be repeated three times. Move the entries to packaging/desktop/*.desktop.in and let msgfmt --desktop merge packaging/desktop/po/*.po into them at build time. Adding a language is one new po file, the PKGBUILDs stay the same size. The "Manage in Shelly" action that shelly-flatpak-integrate appends is now a shipped fragment instead of an inline heredoc, so it gets translated too. Russian is included as the first translation.
39a2372 to
e99207c
Compare
|
Good point — reworked it so the PKGBUILDs stop growing with languages. The entries move out of the heredocs into gettext merges every po file it finds and emits Adding a language is one po file. Measured it: with 15 po files in the folder the built entry carries 15 locales and Two things that fell out of it:
I also renamed my file to Net on the three PKGBUILDs: +68 / -153. If that po folder is wired into Weblate as its own component (#934), translators get the launcher entry for free. |
Shelly's UI already speaks Russian (
Shelly.Ui.Gtk/po/ru_RU.po), but the launcher entry does not, and that entry is the only thing a user sees before the program starts. In a Russian menu the app sits there as "Shelly — A Modern Arch Package Manager", with the right-click actions in English too.The entries are written inline by the PKGBUILDs, so that is where I put the translations:
Comment[ru],Keywords[ru], the three Flatpak action names, the notification service entry, and the "Manage in Shelly" action thatshelly-flatpak-integrateappends. Same change in PKGBUILD, PKGBUILD-git and PKGBUILD-bin so they do not drift apart. Shelly, Flatpak, Arch, pacman and AUR stay in Latin — only the descriptive words are translated.One thing worth knowing about the
Keywords[ru]line: a translated Keywords entry replaces the untranslated one rather than adding to it, so I repeated the whole original list in front of the Russian words. Without that, a Russian session would stop finding Shelly by "package" or "flatpak".desktop-file-validateon the generated file reports nothing new.