There was a lot of inconsistency in how strings that should not be
translated (program names, option flags, PKGBUILD directives, etc) were
handled. This patch moves them all outside the gettext invocation for
consistency and to prevent accidental translation.
Note that some of these may need reverted if they cause difficulties in
translation due to gettext usage in bash not taking positional parameters
for arguments. A quick survey of current translations idicates that this
issue will be rare. Also, we should be able to catch these before a full
string freeze given we are going to probably need a "developer preview"
release before the next release series.
- msg2 "$(gettext "Generating .PKGINFO file...")"
+ msg2 "$(gettext "Generating %s file...")" ".PKGINFO"
echo "# Generated by makepkg $myver"
if (( INFAKEROOT )); then
echo "# using $(fakeroot -v)"
@@ -1081,7 +1081,7 @@ write_pkginfo() {
# warn if license array is not present or empty
if [[ -z $license ]]; then
warning "$(gettext "Please add a license line to your %s!")" "$BUILDSCRIPT"
- plain "$(gettext "Example for GPL'ed software: license=('GPL').")"
+ plain "$(gettext "Example for GPL'ed software: %s.")" "license=('GPL')"
fi
}
@@ -1092,7 +1092,7 @@ check_package() {
local file
for file in "${backup[@]}"; do
if [[ ! -f $file ]]; then
- warning "$(gettext "Backup entry file not in package : %s")" "$file"
+ warning "$(gettext "%s entry file not in package : %s")" "backup" "$file"
fi
done
if (( ! SPLITPKG )); then
- msg "$(gettext "Installing package %s with %s -U...")" "$pkgname" "$PACMAN"
+ msg "$(gettext "Installing package %s with %s...")" "$pkgname" "$PACMAN -U"
else
- msg "$(gettext "Installing %s package group with %s -U...")" "$pkgbase" "$PACMAN"
+ msg "$(gettext "Installing %s package group with %s...")" "$pkgbase" "$PACMAN -U"
fi
local fullver pkg pkglist
@@ -1359,7 +1359,7 @@ check_sanity() {
if (( ! IGNOREARCH )); then
error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgbase" "$CARCH"
plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
- plain "$(gettext "such as arch=('%s').")" "$CARCH"
+ plain "$(gettext "such as %s.")" "arch=('$CARCH')"
ret=1
fi
fi
@@ -1370,7 +1370,7 @@ check_sanity() {
sed -e "s/provides=/provides_list+=/" -e "s/#.*//" -e 's/$//')
for i in ${provides_list[@]}; do
if [[ $i != ${i//</} || $i != ${i//>/} ]]; then
- error "$(gettext "Provides array cannot contain comparison (< or >) operators.")"
+ error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
ret=1
fi
done
@@ -1380,7 +1380,7 @@ check_sanity() {
sed -e "s/backup=/backup_list+=/" -e "s/#.*//" -e 's/$//')
for i in "${backup_list[@]}"; do
if [[ ${i:0:1} = "/" ]]; then
- error "$(gettext "Backup entry should not contain leading slash : %s")" "$i"
+ error "$(gettext "%s entry should not contain leading slash : %s")" "backup" "$i"
ret=1
fi
done
@@ -1391,7 +1391,7 @@ check_sanity() {
for i in "${optdepends_list[@]}"; do
local pkg=${i%%:*}
if [[ ! $pkg =~ ^[[:alnum:]><=.+\_-]+$ ]]; then
- error "$(gettext "Invalid syntax for optdepend : '%s'")" "$i"
+ error "$(gettext "Invalid syntax for %s : '%s'")" "optdepend" "$i"
ret=1
fi
done
@@ -1422,7 +1422,7 @@ check_sanity() {
fi
done
if (( ! known )); then
- error "$(gettext "options array contains unknown option '%s'")" "$i"
+ error "$(gettext "%s array contains unknown option '%s'")" "options" "$i"
valid_options=0
fi
done
@@ -1433,7 +1433,7 @@ check_sanity() {
if (( ${#pkgname[@]} > 1 )); then
for i in ${pkgname[@]}; do
if ! declare -f package_${i} >/dev/null; then
- error "$(gettext "missing package function for split package '%s'")" "$i"
+ error "$(gettext "Missing %s function for split package '%s'")" "package_$i()" "$i"
ret=1
fi
done
@@ -1441,7 +1441,7 @@ check_sanity() {
for i in ${PKGLIST[@]}; do
if ! in_array $i ${pkgname[@]}; then
- error "$(gettext "requested package %s is not provided in %s")" "$i" "$BUILDFILE"
+ error "$(gettext "Requested package %s is not provided in %s")" "$i" "$BUILDFILE"
ret=1
fi
done
@@ -1630,11 +1630,11 @@ usage() {
printf "$(gettext "Usage: %s [options]")
" "$0"
echo
echo "$(gettext "Options:")"
- printf "$(gettext " -A, --ignorearch Ignore incomplete arch field in %s")
" "$BUILDSCRIPT"
+ printf "$(gettext " -A, --ignorearch Ignore incomplete %s field in %s")
" "arch" "$BUILDSCRIPT"
echo "$(gettext " -c, --clean Clean up work files after build")"
echo "$(gettext " -C, --cleancache Clean up source files from the cache")"
echo "$(gettext " -d, --nodeps Skip all dependency checks")"
- echo "$(gettext " -e, --noextract Do not extract source files (use existing src/ dir)")"
+ printf "$(gettext " -e, --noextract Do not extract source files (use existing %s dir)")
" "src/"
echo "$(gettext " -f, --force Overwrite existing package")"
echo "$(gettext " -g, --geninteg Generate integrity checks for source files")"
echo "$(gettext " -h, --help Show this help message and exit")"
@@ -1645,26 +1645,26 @@ usage() {
printf "$(gettext " -p <file> Use an alternate build script (instead of '%s')")
" "$BUILDSCRIPT"
echo "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")"
echo "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")"
- echo "$(gettext " -s, --syncdeps Install missing dependencies with pacman")"
+ printf "$(gettext " -s, --syncdeps Install missing dependencies with %s")
" "pacman"
echo "$(gettext " --allsource Generate a source-only tarball including downloaded sources")"
- echo "$(gettext " --asroot Allow makepkg to run as root user")"
- printf "$(gettext " --check Run the check() function in the %s")
" "$BUILDSCRIPT"
+ printf "$(gettext " --asroot Allow %s to run as root user")
" "makepkg"
+ printf "$(gettext " --check Run the %s function in the %s")
" "check()" "$BUILDSCRIPT"
printf "$(gettext " --config <file> Use an alternate config file (instead of '%s')")
" "$confdir/makepkg.conf"
printf "$(gettext " --holdver Prevent automatic version bumping for development %ss")
" "$BUILDSCRIPT"
- echo "$(gettext " --key <key> Specify a key to use for gpg signing instead of the default")"
- printf "$(gettext " --nocheck Do not run the check() function in the %s")
" "$BUILDSCRIPT"
+ printf "$(gettext " --key <key> Specify a key to use for %s signing instead of the default")
" "gpg"
+ printf "$(gettext " --nocheck Do not run the %s function in the %s")
" "check()" "$BUILDSCRIPT"
echo "$(gettext " --nosign Do not create a signature for the package")"
echo "$(gettext " --pkg <list> Only build listed packages from a split package")"
- echo "$(gettext " --sign Sign the resulting package with gpg")"
+ printf "$(gettext " --sign Sign the resulting package with %s")
" "gpg"
echo "$(gettext " --skipinteg Do not fail when integrity checks are missing")"
echo "$(gettext " --source Generate a source-only tarball without downloaded sources")"
echo
- echo "$(gettext "These options can be passed to pacman:")"
+ printf "$(gettext "These options can be passed to %s:")
" "pacman"
echo
echo "$(gettext " --noconfirm Do not ask for confirmation when resolving dependencies")"
echo "$(gettext " --noprogressbar Do not show a progress bar when downloading files")"
echo
- printf "$(gettext "If -p is not specified, makepkg will look for '%s'")
" "$BUILDSCRIPT"
+ printf "$(gettext "If %s is not specified, %s will look for '%s'")
" "-p" "makepkg" "$BUILDSCRIPT"
echo
}
@@ -1843,7 +1843,7 @@ GPGKEY=${_GPGKEY:-$GPGKEY}
if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then
# The ' ' is here to prevent gettext from thinking --holdver is an option
- error "$(gettext "