Skip to content

Add gettext to Dockerfile dependencies#4

Merged
murar8 merged 4 commits into
murar8:mainfrom
jbellue:gettext
Mar 22, 2026
Merged

Add gettext to Dockerfile dependencies#4
murar8 merged 4 commits into
murar8:mainfrom
jbellue:gettext

Conversation

@jbellue
Copy link
Copy Markdown
Contributor

@jbellue jbellue commented Mar 15, 2026

fix: add gettext support for translation compilation

gnome-extensions pack failed with msgfmt: No such file or directory when processing .po files.

Changes

  1. Dockerfile: Added gettext to base stage (provides /usr/bin/msgfmt runtime)
  2. test.sh: Added translation test verifying .po.mo compilation:
    • Creates test-extension/po/test-extension.po
    • Uses INPUT_GETTEXT_DOMAIN + INPUT_PODIR
    • Verifies standard locale/test-extension/LC_MESSAGES/test-extension.mo output

Before

Failed to execute child process "msgfmt" (No such file or directory)

After

Translations compiled: correct .mo file created!

Proof

Actions run shows all tests passing on my fork

* Add gettext-base to Dockerfile dependencies

* Implement msgfmt availability and translation tests

Added tests for msgfmt availability and translation compilation.

* Refactor Dockerfile to adjust gettext-base dependency

Removed 'gettext-base' from the builder stage and added it to the runtime dependencies.

* Refactor msgfmt checks and add translation test

Updated msgfmt availability checks to run in container and added translation compilation test.

* Update test.sh

* Modify docker build and add gettext verification

Updated docker compose commands to include --no-cache and added verification steps for gettext-base in the test image.

* set gettext in base image and remove from builder

* add gettext domain and locale to metadata

* correct .po path

* remove unneeded step in text container
@jbellue
Copy link
Copy Markdown
Contributor Author

jbellue commented Mar 20, 2026

Hi @murar8
Not sure you're accepting PRs - just thought this would make the action better for i18n.
Thanks

Copy link
Copy Markdown
Owner

@murar8 murar8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Dockerfile change is correct, CI passes. Two minor items:

1. find || echo diagnostic is dead code (test.sh:103)

find exits 0 even with no results, so echo "No .mo files found" never runs:

$ mkdir -p /tmp/empty && find /tmp/empty -name "*.mo" || echo "not found"
$ echo $?
0
# "not found" is never printed

2. No cleanup of test-extension/po/ (test.sh)

The cleanup() trap doesn't remove test-extension/po/, leaving untracked files after local test runs.

@murar8
Copy link
Copy Markdown
Owner

murar8 commented Mar 20, 2026

Hi @jbellue apart from those things I think if it fixes your issue we can get it in!

@jbellue
Copy link
Copy Markdown
Contributor Author

jbellue commented Mar 21, 2026

Hi @murar8 - of course! Sorry about these!
These should be fixed now.

@jbellue jbellue requested a review from murar8 March 21, 2026 22:39
Copy link
Copy Markdown
Owner

@murar8 murar8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@murar8 murar8 merged commit c68beef into murar8:main Mar 22, 2026
3 checks passed
@jbellue jbellue deleted the gettext branch March 22, 2026 11:02
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