-
Notifications
You must be signed in to change notification settings - Fork 98
/
babel
executable file
·54 lines (50 loc) · 1.52 KB
/
babel
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
48
49
50
51
52
53
54
#!/usr/bin/env sh
# SPDX-License-Identifier: BSD-2-Clause
# Copyright Sphinx Confluence Builder Contributors (AUTHORS)
WORK_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
action=
args=("$@")
while [[ $# -gt 0 ]]; do
case $1 in
-*) shift ;;
*) [[ -z "$action" ]] && action=$1
break ;;
esac
done
case $action in
compile)
args+=("--domain=sphinxcontrib.confluencebuilder")
args+=("--directory=sphinxcontrib/confluencebuilder/locale/")
args+=("--use-fuzzy")
;;
extract)
args+=("--keyword=C")
args+=("--keyword=L")
args+=("--ignore-dirs=.*")
args+=("--ignore-dirs=._")
args+=("--ignore-dirs=sandbox*")
args+=("--ignore-dirs=tests*")
args+=("--mapping-file=babel.cfg")
args+=("--no-default-keywords")
args+=("--omit-header")
args+=("--output-file=sphinxcontrib/confluencebuilder/locale/sphinxcontrib.confluencebuilder.pot")
args+=(".")
;;
init)
args+=("--domain=sphinxcontrib.confluencebuilder")
args+=("--input-file=sphinxcontrib/confluencebuilder/locale/sphinxcontrib.confluencebuilder.pot")
args+=("--output-dir=sphinxcontrib/confluencebuilder/locale/")
;;
update)
args+=("--domain=sphinxcontrib.confluencebuilder")
args+=("--input-file=sphinxcontrib/confluencebuilder/locale/sphinxcontrib.confluencebuilder.pot")
args+=("--omit-header")
args+=("--output-dir=sphinxcontrib/confluencebuilder/locale/")
;;
*)
echo "unsupported action"
exit 1
;;
esac
cd $WORK_DIR
exec python -m babel.messages.frontend ${args[@]}