Skip to content

Add metadata for languages#42

Closed
milotype wants to merge 1 commit intopojntfx:mainfrom
milotype:metadata-addition
Closed

Add metadata for languages#42
milotype wants to merge 1 commit intopojntfx:mainfrom
milotype:metadata-addition

Conversation

@milotype
Copy link
Contributor

Added all relevant strings I found in the translation files which can be used in the metadata file for Name, Comment and Keywords.
Not all languages have all necessary strings. Below is a list with comments on missing data. If there is no comment on a language that means that it has all three data.
I did not include en_GB and en_US.
I did not include hi because it has no data whatsoever.

List of languages:

  • de
  • es - NO Keywords
  • et - NO Comment, NO Keywords
  • fi - NO Comment, NO Keywords
  • fr-CA
  • fr
  • hr
  • hu - NO Comment, NO Keywords
  • pt-BR
  • pt
  • ru
  • tr
  • uk
  • vi
  • zh_Hant - NO Comment, NO Keywords

@pojntfx
Copy link
Owner

pojntfx commented Feb 24, 2026

Thanks for your contribution @milotype, but this should not be necessary - all of those things should be translated already. The desktop file is a template (see the .in suffix) and is being rendered, that's why the build is failing: https://github.com/pojntfx/sessions/actions/runs/22308370487/job/64533428954?pr=42#step:4:307

@pojntfx pojntfx closed this Feb 24, 2026
@milotype
Copy link
Contributor Author

@pojntfx Hmm, I'm not a programmer, so I don't realy understand your comment.

On the one hand you write:

all of those things should be translated already

(but looking at the file https://github.com/pojntfx/sessions/blob/main/assets/meta/com.pojtinger.felicitas.Sessions.desktop.in the file is only in English.)

and on the other side you write:

The desktop file is a template (see the .in suffix) and is being rendered, that's why the build is failing

Please give me a short feedback for a non-programmer :-( to understand why my changes aren't necessary.
Thank you.

@pojntfx
Copy link
Owner

pojntfx commented Feb 24, 2026

@milotype Ah OK, I understand! The source file is in English and a template. We then take this file as a template and extract the string to the potfile here:

//go:generate sh -c "find .. -mindepth 1 \\( -name '.*' -o -name builddir \\) -prune -o \\( -name '*.go' -o -name '*.blp' \\) -print | xgettext --language=C++ --keyword=_ --keyword=L --add-comments=TRANSLATORS: --omit-header -o sessions.pot --files-from=- && find .. -mindepth 1 \\( -name '.*' -o -name builddir \\) -prune -o -name '*.desktop.in' -print | xgettext --language=Desktop --keyword=Name --keyword=Comment --add-comments=TRANSLATORS: --omit-header -j -o sessions.pot --files-from=- && find .. -mindepth 1 \\( -name '.*' -o -name builddir \\) -prune -o -name 'metainfo.xml.in' -print | xgettext --its=/usr/share/gettext/its/metainfo.its --omit-header -j -o sessions.pot --files-from=- && find .. -mindepth 1 \\( -name '.*' -o -name builddir \\) -prune -o -name '*.gschema.xml' -print | xgettext --its=/usr/share/gettext/its/gschema.its --omit-header -j -o sessions.pot --files-from=-"

Then, the strings are translated via Weblate.

Once the strings have been translated, they get rendered into the .desktop file (without the .in) here:

//go:generate sh -c "msgfmt --desktop --template ../../assets/meta/com.pojtinger.felicitas.Sessions.desktop.in -d ../../po -o - -f | sed 's|/LC_MESSAGES/default||g' > ../../assets/meta/com.pojtinger.felicitas.Sessions.desktop"

Et voilà, when an end-user installs the Flatpak, the .desktop file will be translated correctly. For example, the title will be "Sitzungen" in German :)

@milotype
Copy link
Contributor Author

@pojntfx Thank you for explaining. So the one file is used as a template, and is populated with the (existing) translation strings when building/generating the app for Flatpak. :-)

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