feat: forked xgettext-go
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
2025-09-30 19:14:16 +02:00
parent 7168234604
commit cb11ca1bbf
3 changed files with 9 additions and 6 deletions

View File

@ -1,15 +1,15 @@
FROM golang:1.24-alpine AS build
FROM golang:1.25-alpine AS build
RUN apk add git && \
git clone https://github.com/snapcore/snapd/ /tmp/snapd/ && \
cd /tmp/snapd/i18n/xgettext-go && \
git clone https://git.coopcloud.tech/toolshed/xgettext-go /tmp/xgettext-go && \
cd /tmp/xgettext-go && \
go build
FROM golang:1.24-alpine
FROM golang:1.25-alpine
WORKDIR /drone/src
COPY --from=build /tmp/snapd/i18n/xgettext-go/xgettext-go /bin/xgettext-go
COPY --from=build /tmp/xgettext-go/xgettext-go /bin/xgettext-go
COPY plugin.sh /plugin/plugin.sh
ENTRYPOINT ["/plugin/plugin.sh"]

View File

@ -2,7 +2,7 @@
[![Build Status](https://build.coopcloud.tech/api/badges/toolshed/drone-xgettext-go/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/toolshed/drone-xgettext-go)
Use `xgettext-go` as a Drone plugin.
Use the forked [`xgettext-go`](https://git.coopcloud.tech/toolshed/xgettext-go) as a Drone plugin.
!!! warning "Caution!"
This is currently configured very specifically for use with Co-op Cloud abra. More customisability Coming Soon™, see #1
@ -14,6 +14,7 @@ Use `xgettext-go` as a Drone plugin.
- **in**: (default: `/drone/src`) The source directory to scan for source files
- **out:** (default: `/drone/src/locales/default.pot`) The target directory in which to create a `pot` file.
- **keyword:** (default: `gotext.Get`) The keyword to search for translatable strings.
- **keyword-ctx:** (default: `gotext.GetC`) The keyword to search for translatable strings with context.
- **comments_tag**: (default: disabled) "place comment blocks starting with TAG and prceding keyword lines in output file"
## Example

View File

@ -5,6 +5,7 @@ set -ex
PLUGIN_IN=${PLUGIN_IN:-/drone/src/}
PLUGIN_OUT=${PLUGIN_OUT:-/drone/src/locales/default.pot}
PLUGIN_KEYWORD=${PLUGIN_KEYWORD:-gotext.Get}
PLUGIN_KEYWORD_CTX=${PLUGIN_KEYWORD_CTX:-gotext.GetC}
run_xgettext_cmd() {
echo "--- start command ---"
@ -15,6 +16,7 @@ run_xgettext_cmd() {
xgettext-go \
-o "$PLUGIN_OUT" \
--keyword="$PLUGIN_KEYWORD" \
--keyword-ctx="$PLUGIN_KEYWORD_CTX" \
--sort-output \
${PLUGIN_COMMENTS_TAG:+--add-comments-tag=}${PLUGIN_COMMENTS_TAG}\
$(find . -name "*.go" -not -path '*vendor*' | sort)