Skip to content

Commit cd5513a

Browse files
avargitster
authored andcommitted
i18n: Makefile: "pot" target to extract messages marked for translation
Add rules to generate a template (po/git.pot) listing messages marked for translation in the C portion of git. To get started translating, just run "make pot". Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0c9ea33 commit cd5513a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ INSTALL = install
321321
RPMBUILD = rpmbuild
322322
TCL_PATH = tclsh
323323
TCLTK_PATH = wish
324+
XGETTEXT = xgettext
324325
PTHREAD_LIBS = -lpthread
325326
PTHREAD_CFLAGS =
326327
GCOV = gcov
@@ -1590,6 +1591,7 @@ ifndef V
15901591
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
15911592
QUIET_GEN = @echo ' ' GEN $@;
15921593
QUIET_LNCP = @echo ' ' LN/CP $@;
1594+
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
15931595
QUIET_GCOV = @echo ' ' GCOV $@;
15941596
QUIET_SUBDIR0 = +@subdir=
15951597
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
@@ -2057,6 +2059,20 @@ info:
20572059
pdf:
20582060
$(MAKE) -C Documentation pdf
20592061

2062+
XGETTEXT_FLAGS = \
2063+
--force-po \
2064+
--add-comments \
2065+
--msgid-bugs-address="Git Mailing List <[email protected]>" \
2066+
--from-code=UTF-8
2067+
XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
2068+
LOCALIZED_C := $(C_OBJ:o=c)
2069+
2070+
po/git.pot: $(LOCALIZED_C)
2071+
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
2072+
mv $@+ $@
2073+
2074+
pot: po/git.pot
2075+
20602076
$(ETAGS_TARGET): FORCE
20612077
$(RM) $(ETAGS_TARGET)
20622078
$(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)

po/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/git.pot

0 commit comments

Comments
 (0)