From a23c1b4f9f81a1da2b0aa426f564c8f954b22965 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 2 Oct 2021 21:21:32 -0300 Subject: Makefile: Generate src/locale/en.sh for translation --- Makefile | 6 +++++- src/locale/en.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/locale/en.sh diff --git a/Makefile b/Makefile index b4f60ce..dab85af 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,11 @@ manpages.in = $(manpages.en.in) \ manpages = $(manpages.in:.in=) -all: src/git-permalink src/load-locale-messages.sh $(manpages) +all: src/git-permalink src/load-locale-messages.sh src/locale/en.sh $(manpages) + + +src/locale/en.sh: src/git-permalink.in + awk '/^# End translatable strings$$/ { exit } { print $$0 }' $? > $@ check: all diff --git a/src/locale/en.sh b/src/locale/en.sh new file mode 100644 index 0000000..a777eac --- /dev/null +++ b/src/locale/en.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -eu + +# +# Translatable strings +# + +_G() { + echo "$1" +} + +MSG_USAGE="$(_G 'Usage: git permalink [-phV] FILE [LINENO]')" +MSG_HELP="$(_G ' +Options: + -p only print the link, don'"'"'t try to open it + -h, --help show this help message + -V, --version print the version number + +See "man git-permalink" for more information. +')" + +MSG_MISSING_FILE="$(_G 'Missing FILE argument.')" + +MSG_UNSUPPORTED_ORIGIN="$(_G 'Unsupported origin: %s. + +Add an template override to use git-permalink (see +"man git-permalink.1" for instructions).')" + +MSG_OPEN="$(_G 'Opening %s')" + +# -- cgit v1.2.3