lila/bin/translate

43 lines
920 B
Plaintext
Raw Normal View History

2012-06-16 05:56:32 -06:00
#!/bin/zsh
version=$(cat bin/.translate_version)
2012-09-15 16:11:42 -06:00
show() {
printf "Log translation %s\n" $version
git log -p t/$(echo $version)
}
next() {
printf "Increment translation version\n"
version=$(($version+1))
echo $version > bin/.translate_version
}
2012-06-16 05:56:32 -06:00
if [ "$1" = "set" ]; then
2012-09-15 16:11:42 -06:00
if [ "$2" ]; then
version="$2"
printf "Set version to %s\n" $2
echo $version > bin/.translate_version
fi
2012-06-16 05:56:32 -06:00
elif [ "$1" = "fetch" ]; then
2012-09-15 16:11:42 -06:00
printf "Fetch from version %s\n" $version
bin/cli i18n-fetch $(echo $version)
2012-06-16 05:56:32 -06:00
elif [ "$1" = "show" ]; then
2012-09-15 16:11:42 -06:00
show
2012-06-16 05:56:32 -06:00
elif [ "$1" = "apply" ]; then
2012-09-15 16:11:42 -06:00
printf "Apply translation %s\n" $version
git cherry-pick t/$(echo $version)
next
show
2012-06-16 05:56:32 -06:00
elif [ "$1" = "next" ]; then
2012-09-15 16:11:42 -06:00
next
show
2012-06-16 05:56:32 -06:00
elif [ "$1" = "commit" ]; then
2012-09-15 16:11:42 -06:00
printf "Commit resolved conflict\n"
(( prevVersion = version -1 ))
git clean -f
git commit -C t/$(echo $prevVersion)
2012-06-16 05:56:32 -06:00
fi
printf "current version: %s\n" $version