Changeset View
Changeset View
Standalone View
Standalone View
trunk/l10n-kf5/scripts/handle_json_files.sh
1 | #! /bin/bash | 1 | #! /bin/bash | ||
---|---|---|---|---|---|
2 | # kate: space-indent on; indent-width 2; replace-tabs on; | 2 | # kate: space-indent on; indent-width 2; replace-tabs on; | ||
3 | 3 | | |||
4 | OLD_PWD=$PWD | ||||
5 | cd $(dirname $0) | ||||
6 | SCRIPTY_DIR=$PWD | ||||
7 | cd $OLD_PWD | ||||
8 | | ||||
4 | get_prj_name() { | 9 | get_prj_name() { | ||
5 | local mod=$1 | 10 | local mod=$1 | ||
6 | echo ${mod} | cut -d'_' -f2 | 11 | echo ${mod} | cut -d'_' -f2 | ||
Context not available. | |||||
9 | extract_json() { | 14 | extract_json() { | ||
10 | arg1=$1; shift | 15 | arg1=$1; shift | ||
11 | dest=$1; shift | 16 | dest=$1; shift | ||
12 | python ./scripts/createjsoncontext.py "$@" "$arg1" > json.$$.tmp | 17 | python $SCRIPTY_DIR/createjsoncontext.py "$@" "$arg1" > json.$$.tmp | ||
13 | msguniq --to-code=UTF-8 -o json.$$ json.$$.tmp 2>/dev/null | 18 | msguniq --to-code=UTF-8 -o json.$$ json.$$.tmp 2>/dev/null | ||
14 | if test -f json.$$; then | 19 | if test -f json.$$; then | ||
15 | if test ! -f "$dest"; then | 20 | if test ! -f "$dest"; then | ||
Context not available. | |||||
39 | 44 | | |||
40 | extract_json $repo_dir "templates/messages/${mod_po_path}/${prj_name}._json_.pot" $jsonfilelist | 45 | extract_json $repo_dir "templates/messages/${mod_po_path}/${prj_name}._json_.pot" $jsonfilelist | ||
41 | for jsonfile in $jsonfilelist; do | 46 | for jsonfile in $jsonfilelist; do | ||
42 | python ./scripts/filljsonfrompo.py $repo_dir "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" | 47 | python $SCRIPTY_DIR/filljsonfrompo.py $repo_dir "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" | ||
43 | done | 48 | done | ||
44 | fi | 49 | fi | ||
45 | done | 50 | done | ||
Context not available. |