From 6a141f764ed4110d9511de2d8d3e355c10dfcadc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 10 Sep 2010 18:57:20 +0000 Subject: [PATCH] gettext docs: the git-sh-i18n.sh Shell interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change po/README's "Marking strings for translation" section so that it covers the git-sh-i18n.sh Shell interface. The existing documentation in git-sh-i18n.sh has been moved to the README file, to avoid them drifting in apart.. Signed-off-by: Ævar Arnfjörð Bjarmason --- git-sh-i18n.sh | 16 ++-------------- po/README | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh index b8b645a64..f8dd43a80 100644 --- a/git-sh-i18n.sh +++ b/git-sh-i18n.sh @@ -2,20 +2,8 @@ # # Copyright (c) 2010 Ævar Arnfjörð Bjarmason # -# This is Git's interface to gettext.sh. Use it right after -# git-sh-setup as: -# -# . git-sh-setup -# . git-sh-i18n -# -# # For constant interface messages: -# gettext "A message for the user"; echo -# -# # To interpolate variables: -# details="oh noes" -# eval_gettext "An error occured: \$details"; echo -# -# See "info '(gettext)sh'" for the full manual. +# This is Git's interface to gettext.sh. See po/README for usage +# instructions. # Export the TEXTDOMAIN* data that we need for Git TEXTDOMAIN=git diff --git a/po/README b/po/README index fea8bf872..a93c88dfd 100644 --- a/po/README +++ b/po/README @@ -145,3 +145,26 @@ C: Here _() couldn't have statically determined what the translation string will be, but since it was already marked for translation with N_() the look-up in the message catalog will succeed. + +Shell: + + - The Git gettext shell interface is just a wrapper for + gettext.sh. Import it right after git-sh-setup like this: + + . git-sh-setup + . git-sh-i18n + + And then use the gettext or eval_gettext functions: + + # For constant interface messages: + gettext "A message for the user"; echo + + # To interpolate variables: + details="oh noes" + eval_gettext "An error occured: \$details"; echo + + More documentation about the interface is available in the GNU info + page: `info '(gettext)sh'`. Looking at git-am.sh (the first shell + command to be translated) for examples is also useful: + + git log --reverse -p --grep=gettextize git-am.sh -- 2.30.2