Skip to content

packaging: translate the desktop entries to Russian - #1739

Open
wehrwolfmann wants to merge 1 commit into
Seafoam-Labs:developmentfrom
wehrwolfmann:ru-desktop-entries
Open

packaging: translate the desktop entries to Russian#1739
wehrwolfmann wants to merge 1 commit into
Seafoam-Labs:developmentfrom
wehrwolfmann:ru-desktop-entries

Conversation

@wehrwolfmann

Copy link
Copy Markdown

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 that shelly-flatpak-integrate appends. 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-validate on the generated file reports nothing new.

@azdanov

azdanov commented Aug 20, 2026

Copy link
Copy Markdown
Member

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.
@wehrwolfmann

Copy link
Copy Markdown
Author

Good point — reworked it so the PKGBUILDs stop growing with languages.

The entries move out of the heredocs into packaging/desktop/*.desktop.in, translations into packaging/desktop/po/. Build time is one loop:

msgfmt --desktop --template="$template" -d po -o "${template%.in}"

gettext merges every po file it finds and emits Comment[xx], Name[xx] and Keywords[xx], including inside [Desktop Action …] groups. Same tool and same loop shape the PKGBUILDs already use for the .mo files, so no new makedepends. It's also what meson's i18n.merge_file(type: 'desktop') runs under the hood, so most GTK apps ship their entries this way.

Adding a language is one po file. Measured it: with 15 po files in the folder the built entry carries 15 locales and git diff PKGBUILD comes back empty. With the folder empty it builds the plain English entry and desktop-file-validate still passes. msgfmt exits 0 even when it merged nothing, so build() checks the result and fails rather than shipping silently untranslated entries.

Two things that fell out of it:

  • "Manage in Shelly" is now a shipped fragment at /usr/share/shelly/flatpak-action.desktop that shelly-flatpak-integrate appends, so that action gets translated too.
  • PKGBUILD-bin has no source tree, so release.yml generates the entries and drops them in the tarball next to locale/. shelly-bin picks them up from the first release built with the new workflow.

I also renamed my file to ru.po: Comment[ru_RU] only matches an ru_RU session, [ru] also covers ru_UA/ru_BY/ru_KZ.

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.

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 this pull request may close these issues.

2 participants