mirror of
https://github.com/friendica/friendica
synced 2025-02-19 14:46:47 +00:00
commit
10f5f0358a
1 changed files with 12 additions and 6 deletions
|
@ -4,7 +4,14 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
set -eo pipefail
|
set -e
|
||||||
|
|
||||||
|
# Custom function to handle pipefail behavior
|
||||||
|
pipefail() {
|
||||||
|
local cmd="$1"
|
||||||
|
shift
|
||||||
|
{ eval "$cmd"; } || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
resolve() {
|
resolve() {
|
||||||
if [ "$(uname)" = "Darwin" ]
|
if [ "$(uname)" = "Darwin" ]
|
||||||
|
@ -78,13 +85,13 @@ echo "Extract strings to $OUTFILE.."
|
||||||
# shellcheck disable=SC2086 # $FINDOPTS is meant to be split
|
# shellcheck disable=SC2086 # $FINDOPTS is meant to be split
|
||||||
find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f | LC_ALL=C sort -s)
|
find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f | LC_ALL=C sort -s)
|
||||||
|
|
||||||
total_files=$(wc -l <<< "${find_result}")
|
total_files=$(echo "${find_result}" | wc -l)
|
||||||
|
|
||||||
count=1
|
count=1
|
||||||
for file in $find_result
|
for file in $find_result
|
||||||
do
|
do
|
||||||
echo -ne " \r"
|
printf " \r"
|
||||||
echo -ne "Reading file $count/$total_files..."
|
printf "Reading file %d/%d..." "$count" "$total_files"
|
||||||
|
|
||||||
# On Windows, find still outputs the name of pruned folders
|
# On Windows, find still outputs the name of pruned folders
|
||||||
if [ ! -d "$file" ]
|
if [ ! -d "$file" ]
|
||||||
|
@ -93,9 +100,8 @@ do
|
||||||
xgettext $KEYWORDS --no-wrap -j -o "$OUTFILE" --from-code=UTF-8 "$file" || exit 1
|
xgettext $KEYWORDS --no-wrap -j -o "$OUTFILE" --from-code=UTF-8 "$file" || exit 1
|
||||||
sed -i.bkp "s/CHARSET/UTF-8/g" "$OUTFILE"
|
sed -i.bkp "s/CHARSET/UTF-8/g" "$OUTFILE"
|
||||||
fi
|
fi
|
||||||
(( count++ ))
|
count=$((count + 1))
|
||||||
done
|
done
|
||||||
echo -ne "\n"
|
|
||||||
|
|
||||||
echo "Interpolate metadata.."
|
echo "Interpolate metadata.."
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue