X-Git-Url: https://git.p6c8.net/jirafeau/pcanterino.git/blobdiff_plain/2dc4984ad57dfcb0ded829bfc9d45493484fe6e3..6cdb006ec660dc477c857a95601e3ba50244add0:/lib/locales/add.sh diff --git a/lib/locales/add.sh b/lib/locales/add.sh new file mode 100755 index 0000000..aba8bc9 --- /dev/null +++ b/lib/locales/add.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +new=$1 +if [ -z "$new" ]; then + echo "please pass the new string id to add as parameter" + exit 1 +fi +locales_dir=$(cd "$(dirname $0)" && pwd) +new_line=" \"$new\": \"\"," +find $locales_dir -type f -name "*.json" -print0 | xargs -0 sed -i "s/{/{\n${new_line}/"