[pacman-dev] [PATCH] Gettext support in gensync
Add gettext support to gensync.
Signed-off-by: Giovanni Scafora
Giovanni Scafora wrote:
Add gettext support to gensync.
Signed-off-by: Giovanni Scafora
diff --git a/scripts/gensync b/scripts/gensync index f99cf59..fa88f32 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -20,28 +20,37 @@ # USA. #
+# gettext initialization" +source gettext.sh + +TEXTDOMAIN=gensync +export TEXTDOMAIN +TEXTDOMAINDIR='@localedir@' +export TEXTDOMAINDIR +
Is there any reason why we can't use a common TEXTDOMAIN for all the scripts. I think with a little tidying up we'll find that there's a lot of standard messages in the scripts, and it would be easier for translators to maintain if it was all in the same .mo file. Also Dan reminded me you can't use $() and $1 in eval_gettext, so to make life easier we might want to use printf instead of echo in the output functions. eg from abs error "$(eval_gettext "invalid root dir: \$rootdir")" would become error "$(gettext "invalid root dir: %s")" $rootdir and change the output functions to something like local msg=$1; shift printf "==> ERROR: $msg\n" $* Andrew
On 4/2/07, Andrew Fyfe
Giovanni Scafora wrote:
Add gettext support to gensync.
Signed-off-by: Giovanni Scafora
diff --git a/scripts/gensync b/scripts/gensync index f99cf59..fa88f32 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -20,28 +20,37 @@ # USA. #
+# gettext initialization" +source gettext.sh + +TEXTDOMAIN=gensync +export TEXTDOMAIN +TEXTDOMAINDIR='@localedir@' +export TEXTDOMAINDIR +
Is there any reason why we can't use a common TEXTDOMAIN for all the scripts. I think with a little tidying up we'll find that there's a lot of standard messages in the scripts, and it would be easier for translators to maintain if it was all in the same .mo file.
Yes, this is something I forgot in my last email. We definitely want to have one textdomain, which will more than likely be 'pacman'. There are still quite a few details to work out with regards to translations- adding the gettext calls is only part of the issue. More than likely our po directory will need to move to the root of the checkout. -Dan
On 4/2/07, Giovanni Scafora
Add gettext support to gensync.
Signed-off-by: Giovanni Scafora
I don't want to burst your efforts here- but gensync is in some ways a depreciated script and repo-add is much preferred. I don't know if we should add this to it, but then again, there isn't a real compelling reason against it. -Dan
participants (3)
-
Andrew Fyfe
-
Dan McGee
-
Giovanni Scafora