MOBILE-2613 lang: Add option to make create lang index faster

main
Pau Ferrer Ocaña 2018-10-16 10:50:19 +02:00
parent b015770835
commit c7e799b75b
1 changed files with 4 additions and 2 deletions

View File

@ -219,6 +219,7 @@ function find_better_file {
#Parses the file.
function parse_file {
findbetter=$2
keys=`jq -r 'keys[]' $1`
for key in $keys; do
# Check if already parsed.
@ -229,7 +230,7 @@ function parse_file {
value=`$exec`
if [ -z "$found" ] || [ "$found" == 'null' ]; then
guess_file $key "$value"
else
elif [ ! -z "$findbetter" ]; then
find_better_file "$key" "$value" "$found"
fi
done
@ -253,7 +254,8 @@ if [ ! -f 'langindex.json' ]; then
echo "{}" > langindex.json
fi
parse_file '../src/assets/lang/en.json'
findbetter=$1
parse_file '../src/assets/lang/en.json' $findbetter
echo