Skip to content

Commit

Permalink
feat: improve scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Mar 21, 2021
1 parent 64bc522 commit 52b3f7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/tools/generate-pot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ xgettext \
[email protected] \
--from-code=utf-8 \
--keyword=gettext --keyword=pgettext:1c,2 --keyword=ngettext:1,2 \
-p $2 \
-p "$2" \
--from-code=UTF-8 \
--add-comments=l10n \
--add-location -L PHP $(find "$1" \( -name "*.php" \) | sort) \
Expand Down
12 changes: 6 additions & 6 deletions scripts/update-example.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
#!/bin/sh

ME="$(realpath $(dirname $0))"
ROOTDIR="$(realpath $(dirname $0)/../)"

rm -rf $ROOTDIR/example/twigcache
mkdir $ROOTDIR/example/twigcache
rm -rf "$ROOTDIR/example/twigcache"
mkdir "$ROOTDIR/example/twigcache"

$ME/tools/generate-twig-cache.php \
--twig-cache-dir="$ROOTDIR/example/twigcache" \
Expand All @@ -14,12 +14,12 @@ $ME/tools/generate-twig-cache.php \
--title="Wdes example" \
--copyright="William Desportes <[email protected]>" \
--package-version="1.0.0"
sh $ME/tools/generate-pot.sh $ROOTDIR/example/twigcache $ROOTDIR/example/locale example.pot
sh $ME/tools/generate-pot.sh "$ROOTDIR/example/twigcache" "$ROOTDIR/example/locale" example.pot
$ME/tools/update-po-files.php \
--po-dir="$ROOTDIR/example/locale" \
--po-template="$ROOTDIR/example/locale/example.pot" \
--json-mapping="$ROOTDIR/example/locale/replace.json"
rm -rf $ROOTDIR/example/twigcache
rm $ROOTDIR/example/locale/replace.json
rm -rf "$ROOTDIR/example/twigcache"
rm "$ROOTDIR/example/locale/replace.json"

msgfmt --directory="$ROOTDIR/example/locale" --check -o "$ROOTDIR/example/locale/fr.mo" "$ROOTDIR/example/locale/fr.po"

0 comments on commit 52b3f7e

Please sign in to comment.