From e33efbce149bce4b1d35461b03460d2ba7758aae Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 6 Jul 2007 05:34:50 +0000 Subject: [PATCH] The -t option of this script is ready for Ivanovic to try. --- utils/change_textdomain | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/change_textdomain b/utils/change_textdomain index 55e76cd500d..c3254d96e98 100755 --- a/utils/change_textdomain +++ b/utils/change_textdomain @@ -53,6 +53,9 @@ # # 7) replace wesnoth-oldtextdomain by wesnoth-newtextdomain in configure.ac # +# Later, I added the -t option to insert a default textdomain in files that +# don't have it. +# # Note: This script is rather sensitive to the current directory layout -- # the campaigns directory is required to be under data, po directly under # toplevel, etc. It will silently break if these assumptions stop being true. @@ -129,14 +132,15 @@ svnmove() add_textdomain() # Add '#textdomain wesnoth' to files that don't have it. { - for file in `find data -name "*.cfg" -print` + for file in `find data -name "*.cfg" -print | grep -v 'data/languages'` do if grep '#textdomain' $file >/dev/null then : else - # FIXME: The per-file transformation still needs to be implemented - echo $file + ${do} echo "#textdomain wesnoth" >/tmp/ctd$$.tmp + ${do} cat $file >>/tmp/ctd$$.tmp + ${do} cp /tmp/ctd$$.tmp $file fi done }