mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
script to check .xml and .java files for missing string entries and to
add stubs.
This commit is contained in:
parent
8a4c31b203
commit
73749f97a5
1 changed files with 32 additions and 0 deletions
32
xwords4/android/scripts/add_strings.sh
Executable file
32
xwords4/android/scripts/add_strings.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
check_add () {
|
||||
STRING=$1
|
||||
PAT="<string name=\"$STRING\">.*</string>"
|
||||
if ! grep -q "$PAT" res/values/strings.xml; then
|
||||
echo "<string name=\"$STRING\">$STRING</string>"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
BASE=$(dirname $0)
|
||||
cd $BASE/../XWords4
|
||||
|
||||
for XML_FILE in $(find res/layout -name '*.xml'); do
|
||||
for STRING in $(grep 'android:text=' $XML_FILE | sed 's,^.*"@string/\(.*\)".*$,\1,'); do
|
||||
check_add $STRING
|
||||
done
|
||||
done
|
||||
|
||||
for XML_FILE in $(find res/menu -name '*.xml'); do
|
||||
for STRING in $(grep 'android:title=' $XML_FILE | sed 's,^.*"@string/\(.*\)".*$,\1,'); do
|
||||
check_add $STRING
|
||||
done
|
||||
done
|
||||
|
||||
for JAVA_FILE in $(find src -name '*.java'); do
|
||||
for STRING in $(grep -E 'R\.string\.' $JAVA_FILE | sed 's/^.*R\.string\.\([a-z_]*\).*$/\1/'); do
|
||||
check_add $STRING
|
||||
done
|
||||
done
|
||||
|
Loading…
Add table
Reference in a new issue