[SCM] live-manual branch, debian, updated. debian/3.0_a10-1-39-g216427c
chals
chals at altorricon.com
Tue Apr 3 07:21:43 UTC 2012
The following commit has been merged in the debian branch:
commit c9f3182fe964ca13c4432c6a94c11d7de0c923c8
Author: chals <chals at altorricon.com>
Date: Sat Mar 10 15:35:54 2012 +0100
Adding translate target to assist translators in selectively finding and fixing fuzzy strings in their respective languages.
diff --git a/Makefile b/Makefile
index 28dcf0b..7a4c188 100644
--- a/Makefile
+++ b/Makefile
@@ -71,16 +71,17 @@ commit: tidy test
@if grep -qs fuzzy manual/po/*/*; \
then \
- echo "Please fix fuzzy in manual/po/* first."; \
- exit 1; \
+ echo "" ; \
+ echo "There are some fuzzy strings. You can run 'make translate' to fix them." ; \
+ exit 1 ; \
fi
@echo
- @echo "Successful... please do:"
+ @echo "You may now proceed...please do:"
@echo
@echo " * git add ."
@echo " * git commit -a -m \"Your commit message.\""
- @echo " * git push"
+ @echo " * git push "
install:
FROMDIR=$(CURDIR)/build/manual; \
@@ -102,3 +103,12 @@ distclean: clean
rm -rf build
rebuild: distclean build
+
+translate:
+ @if grep -qs fuzzy manual/po/*/*; \
+ then \
+ ./manual/bin/find-fuzzy.sh ; \
+ else \
+ echo "There are no fuzzy strings to translate." ; \
+ fi
+
diff --git a/manual/bin/find-fuzzy.sh b/manual/bin/find-fuzzy.sh
new file mode 100755
index 0000000..3f29ce1
--- /dev/null
+++ b/manual/bin/find-fuzzy.sh
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Script to assist translators in finding and fixing fuzzy strings in live-manual.
+
+echo ""
+echo "This script can help you find and fix fuzzy strings. What is your language?."
+echo "Type de, es, fr, it, pt_BR or ro"
+echo "['q' to quit]."
+
+# Editor defaults to vim unless otherwise specified in preferences.
+
+EDITOR=${EDITOR:-vim}
+
+# Creating the function. Searches 'fuzzy' and offers to open editor to fix them.
+
+find_fuzzy()
+
+{
+ echo ""
+ echo "There are $(grep -w 'fuzzy' manual/po/$ANSWER/* | wc -l) fuzzy strings in your language."
+ echo ""
+
+ grep -w 'fuzzy' manual/po/$ANSWER/*
+
+ if [ "$(grep -w 'fuzzy' manual/po/$ANSWER/* | wc -l)" = "0" ]
+ then
+ echo "You may now proceed...please do:"
+ echo ""
+ echo " * git add ."
+ echo " * git commit -a -m \"Your commit message.\""
+ echo " * git push "
+ echo ""
+ exit 0
+ else
+ echo ""
+ echo "Do you want to launch your text editor to start fixing them? [yes/no]"
+
+ read OPENEDITOR
+ case $OPENEDITOR in
+
+ y*|Y*) $EDITOR $(grep -w 'fuzzy' manual/po/$ANSWER/* | uniq | sed 's|:#, fuzzy||')
+ ;;
+ n*|N*) exit 0
+ ;;
+ *) echo "You didn't type 'yes'. Exiting..."
+ exit 0
+
+ esac
+
+ fi
+ exit 0
+}
+
+# Languages menu.
+
+read ANSWER
+case "$ANSWER" in
+
+ de) find_fuzzy
+ ;;
+
+ en) echo "Nothing to be done, really."
+ echo "Translation English-English not implemented yet!"
+ ;;
+
+ es) find_fuzzy
+ ;;
+
+ fr) find_fuzzy
+ ;;
+
+ it) find_fuzzy
+ ;;
+
+ pt_BR) find_fuzzy
+ ;;
+
+ ro) find_fuzzy
+ ;;
+
+ q) exit
+ ;;
+
+ *) echo "No language chosen. Exiting..."
+
+esac
+
+
+
+
--
live-manual
More information about the debian-live-changes
mailing list