2806
$(check_po_file_envvar)
2807
@if test ! -e $(PO_FILE); then \
2808
echo >&2 "error: $(PO_FILE) does not exist"; \
2809
+ echo >&2 'To create an initial po file, use: "make po-init PO_FILE=po/XX.po"'; \
2810
exit 1; \
2811
fi
2812
$(QUIET_MSGMERGE)$(MSGMERGE) $(MSGMERGE_FLAGS) $(PO_FILE) po/git.pot
2814
.PHONY: check-pot
2815
check-pot: $(LOCALIZED_ALL_GEN_PO)
2816
2817
+### TODO FIXME: Translating everything in these files is a bad
2818
+### heuristic for "core", as we'll translate obscure error() messages
2819
+### along with commonly seen i18n messages. A better heuristic would
2820
+### be to e.g. use spatch to first remove error/die/warning
2821
+### etc. messages.
2822
+LOCALIZED_C_CORE =
2823
+LOCALIZED_C_CORE += builtin/checkout.c
2824
+LOCALIZED_C_CORE += builtin/clone.c
2825
+LOCALIZED_C_CORE += builtin/index-pack.c
2826
+LOCALIZED_C_CORE += builtin/push.c
2827
+LOCALIZED_C_CORE += builtin/reset.c
2828
+LOCALIZED_C_CORE += remote.c
2829
+LOCALIZED_C_CORE += wt-status.c
2830
+
2831
+LOCALIZED_C_CORE_GEN_PO = $(LOCALIZED_C_CORE:%=.build/pot/po/%.po)
2832
+
2833
+.build/pot/git-core.header: $(LOCALIZED_C_CORE_GEN_PO)
2834
+ $(call mkdir_p_parent_template)
2835
+ $(QUIET_GEN)$(gen_pot_header)
2836
+
2837
+po/git-core.pot: .build/pot/git-core.header $(LOCALIZED_C_CORE_GEN_PO)
2838
+ $(QUIET_GEN)$(MSGCAT) $^ >$@
2839
+
2840
+.PHONY: po-init
2841
+po-init: po/git-core.pot
2842
+ $(check_po_file_envvar)
2843
+ @if test -e $(PO_FILE); then \
2844
+ echo >&2 "error: $(PO_FILE) exists already"; \
2845
+ exit 1; \
2846
+ fi
2847
+ $(QUIET_MSGINIT)msginit \
2848
+ --input=$< \
2849
+ --output=$(PO_FILE) \
2850
+ --no-translator \
2851
+ --locale=$(PO_FILE:po/%.po=%)
2852
+
2853
+## po/*.po files & their rules
2854
ifdef NO_GETTEXT
2855
POFILES :=
2856
MOFILES :=
3386
3387
clean: profile-clean coverage-clean cocciclean
3388
$(RM) -r .build
3351
- $(RM) po/git.pot
3389
+ $(RM) po/git.pot po/git-core.pot
3390
$(RM) *.res
3391
$(RM) $(OBJECTS)
3392
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)