forked from Sudomemo/sudomemo-locales
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean_all.sh
executable file
·28 lines (25 loc) · 785 Bytes
/
clean_all.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
#!/bin/bash
# if a locale file name is passed as an argument, use it
if [ $# -eq 1 ]; then
LOCALE_FILE=$1
else
LOCALE_FILE="*"
fi
if [ "$DO_SORT" = "true" ]; then
DO_SORT=true
else
DO_SORT=false
fi
for domain in $(ls en_US/LC_MESSAGES/$LOCALE_FILE.po|xargs -L1 basename); do
for lang in $(echo ??_??); do
# Don't sort unless we edit in the -s flag
# This way we don't cause massive merge conflicts all the time
if $DO_SORT; then
echo "Cleaning and sorting $lang/LC_MESSAGES/$domain"
msgcat -s --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain
else
echo "Cleaning $lang/LC_MESSAGES/$domain"
msgcat --to-code=UTF-8 --no-wrap --lang=$lang $lang/LC_MESSAGES/$domain -o $lang/LC_MESSAGES/$domain
fi
done
done