Commit 6cdb006e authored by Jérôme Jutteau's avatar Jérôme Jutteau

[TASK] Add scripts to add, remove and delete locales

Signed-off-by: Jérôme Jutteau's avatarJerome Jutteau <j.jutteau@gmail.com>
parent 2dc4984a
#!/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}/"
#!/bin/bash
set -e
id=$1
if [ -z "$id" ]; then
echo "please pass the string id to remove as parameter"
exit 1
fi
locales_dir=$(cd "$(dirname $0)" && pwd)
find $locales_dir -type f -name "*.json" -print0 | xargs -0 sed -i "/$id/d"
#!/bin/bash
original_id=$1
new_id=$2
if [ -z "$original_id" ] || [ -z "$new_id" ] ; then
echo "arguments: [OLD_ID] [NEW_ID]"
exit 1
fi
locales_dir=$(cd "$(dirname $0)" && pwd)
o="\"$original_id\":"
i="\"$new_id\":"
find . -type f -name "*.json" -print0 | xargs -0 sed -i "s/$o/$i/g"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment