From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 1/3] gettext: Add po/README file documenting Git's gettext
Date: Fri, 3 Sep 2010 23:24:54 +0000 [thread overview]
Message-ID: <1283556296-7365-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <AANLkTi=6ctLp-8FeqOGMZuhwvM_7DbaEp7+LK4nXfCaE@mail.gmail.com>
Add a po/README file. This documentation is targated at translators
and maintainers of git.git.
Currently it describes how to add new PO files and how to update
them. But in the future we want to add more things to it, e.g. how and
what to add in TRANSLATOR comments, how to make the source more
gettext friendly etc.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Turns out we do just fine with --no-location.
po/README | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 68 insertions(+), 0 deletions(-)
create mode 100644 po/README
diff --git a/po/README b/po/README
new file mode 100644
index 0000000..cca8012
--- /dev/null
+++ b/po/README
@@ -0,0 +1,68 @@
+Core GIT Translations
+=====================
+
+This directory holds the translations for the core of Git. This
+document describes how to add to and maintain these translations.
+
+
+Generating a .pot file
+----------------------
+
+The po/git.pot file contains a message catalog extracted from Git's
+sources. You need to generate it to add new translations with
+msginit(1), or update existing ones with msgmerge(1).
+
+Since the file can be automatically generated it's not checked into
+git.git. To generate it do, at the top-level:
+
+ make pot
+
+
+Initializing a .po file
+-----------------------
+
+To add a new translation first generate git.pot (see above) and then
+in the po/ directory do:
+
+ msginit --locale=XX --no-translator
+
+Where XX is your locale, e.g. "is", "de" or "pt_BR".
+
+Then, because msginit(1) will include a lot of superfluous info we
+don't want run this on it:
+
+ perl -ni -e '
+ if (1 .. /^$/) {
+ s/^#.*\n//;
+ s/(?<=Project-Id-Version: )PACKAGE VERSION/Git/;
+ s/"(?:PO-Revision-Date|Language-Team|Last-Translator): .*\n//;
+ }
+ s/^#: .*\n//;
+ print
+ ' XX.po
+
+We omit removing "POT-Creation-Date", because msgmerge(1) always adds
+it if it isn't present, and removing it after each msgmerge is harder
+than just including it to begin with.
+
+
+Updating a .po file
+-------------------
+
+If there's an existing *.po file for your language but you need to
+update the translation you first need to generate git.pot (see above)
+and then in the po/ directory do:
+
+ msgmerge --no-location --backup=off -U XX.po git.pot
+
+Where XX.po is the file you want to update.
+
+If you want to generate location comments (it can be very useful to
+see the source for context while translating) do:
+
+ msgmerge --add-location --backup=off -U XX.po git.pot
+
+But then you need remember to remove the comments before you submit
+the file upstream:
+
+ perl -pi -e 's/^#: .*\n//' XX.po
--
1.7.2.2.336.g704fc
next prev parent reply other threads:[~2010-09-03 23:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 18:22 [GIT PULL] New ab/i18n series and builtin fixes Ævar Arnfjörð Bjarmason
2010-09-03 23:24 ` [PATCH 0/3] ab/i18n: README and GETTEXT_POISON support Ævar Arnfjörð Bjarmason
2010-09-03 23:24 ` Ævar Arnfjörð Bjarmason [this message]
2010-09-03 23:24 ` [PATCH 2/3] gettext: Add GETTEXT_POISON=YesPlease Makefile parameter Ævar Arnfjörð Bjarmason
2010-09-03 23:24 ` [PATCH 3/3] gettext: add NO_GETTEXT_POISON prerequisite to tests Ævar Arnfjörð Bjarmason
2010-09-03 23:41 ` Ævar Arnfjörð Bjarmason
2010-09-04 0:49 ` [PATCH 0/2] [PULL] ab/i18n-gettextize & translations avarab
2010-09-04 0:49 ` [PATCH 1/2] po/de.po: add German translation avarab
2010-09-06 15:41 ` Thomas Rast
2010-09-06 16:09 ` Jan Krüger
2010-09-06 17:06 ` Ævar Arnfjörð Bjarmason
2010-09-06 16:24 ` Jens Lehmann
2010-09-06 19:58 ` Tilo Schwarz
2010-09-06 17:15 ` Ævar Arnfjörð Bjarmason
2010-09-04 0:49 ` [PATCH 2/2] po/en_GB.po: add British English Translation avarab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283556296-7365-2-git-send-email-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).