forked from mozillahispano/gaia-l10n-transifex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimport.sh
executable file
·47 lines (42 loc) · 1.33 KB
/
import.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
GITBASE=`pwd`"/.."
HGBASE=`pwd`
cd $HGBASE
if [[ -z "$1" ]]
then
echo "Usage: $0 [properties|manifest]"
echo
echo " properties Import en-US properties files from git."
echo " manifests Import en-US manifests files from git."
echo
echo "The import command uses jq. Download from http://stedolan.github.com/jq/"
exit 1
fi
if [[ "$1" == "properties" ]]
then
rm -rf ../apps/system/camera
# migrate properties files
for f in $(find .. -name "*.en-US.properties")
do
new="$HGBASE/en-US/$(echo $f | sed -e 's/..\///' -e 's/locales\///' -e 's/en-US.//')"
mkdir -p $(dirname $new)
echo "importing $f"
cp $f $new
done
rm en-US/shared/branding/official/branding.properties
exit 0
fi
if [[ "$1" == "manifests" ]]
then
rm -rf ../apps/system/camera
# migrate manifest files
for f in $(find ../apps ../showcase_apps ../external-apps -name "manifest.webapp")
do
new="$HGBASE/en-US/$(echo $f | sed -e 's/..\///' -e 's/webapp/properties/')"
mkdir -p $(dirname $new)
echo "importing $f"
cat $f | jq '.locales["en-US"].name' | sed -e "s/^/name=/" -e 's/"//g' > $new
cat $f | jq '.locales["en-US"].description' | sed -e "s/^/description=/" -e 's/"//g' >> $new
done
exit 0
fi