Re: [PATCH v2 8/9] Makefile: add "po-init" rule to initialize po/XX.po

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 19 2022, Jiang Xin wrote:

> From: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
>
> The core translation is the minimum set of work that must be done for a
> new language translation.
>
> There are over 5000 messages in the template message file "po/git.pot"
> that need to be translated. It is not a piece of cake for such a huge
> workload. So we used to define a small set of messages called "core
> translation" that a new l10n contributor must complete before sending
> pull request to the l10n coordinator.
>
> By pulling in some parts of the git-po-helper[^1] logic, we add rule
> "core-pot" to create this core translation message "po/git-core.pot":
>
>     make core-pot
>
> To help new l10n contributors to initialized their "po/XX.pot" from
> "po/git-core.pot", we also add new rules "po-init":
>
>     make po-init POT_FILE=po/XX.po

This is a typo, you mean PO_FILE, not POT_FILE.

>  Makefile      | 44 ++++++++++++++++++++++++++++++++++++++++++++
>  po/.gitignore |  1 +
>  shared.mak    |  1 +
>  3 files changed, 46 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index edebd44d5c..0a687a6eb2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2801,6 +2801,7 @@ po-update: po/git.pot
>  	$(check_po_file_envvar)
>  	@if test ! -e $(PO_FILE); then \
>  		echo >&2 "error: $(PO_FILE) does not exist"; \
> +		echo >&2 'To create an initial po file, use: "make po-init PO_FILE=po/XX.po"'; \

Correct here.

>  		exit 1; \
>  	fi
>  	$(QUIET_MSGMERGE)$(MSGMERGE) $(MSGMERGE_FLAGS) $(PO_FILE) po/git.pot
> @@ -2808,6 +2809,49 @@ po-update: po/git.pot
>  .PHONY: check-pot
>  check-pot: $(LOCALIZED_ALL_GEN_PO)
>  
> +### TODO FIXME: Translating everything in these files is a bad
> +### heuristic for "core", as we'll translate obscure error() messages
> +### along with commonly seen i18n messages. A better heuristic would
> +### be to e.g. use spatch to first remove error/die/warning
> +### etc. messages.
> +LOCALIZED_C_CORE =
> +LOCALIZED_C_CORE += builtin/checkout.c
> +LOCALIZED_C_CORE += builtin/clone.c
> +LOCALIZED_C_CORE += builtin/index-pack.c
> +LOCALIZED_C_CORE += builtin/push.c
> +LOCALIZED_C_CORE += builtin/reset.c
> +LOCALIZED_C_CORE += remote.c
> +LOCALIZED_C_CORE += wt-status.c
> +
> +LOCALIZED_C_CORE_GEN_PO = $(LOCALIZED_C_CORE:%=.build/pot/po/%.po)
> +
> +.PHONY: core-pot
> +core-pot: po/git-core.pot
> +
> +.build/pot/git-core.header: $(LOCALIZED_C_CORE_GEN_PO)
> +	$(call mkdir_p_parent_template)
> +	$(QUIET_XGETTEXT)$(XGETTEXT) $(XGETTEXT_FLAGS_C) \
> +		-o - /dev/null | \
> +	sed -e 's|charset=CHARSET|charset=UTF-8|g' >$@ && \
> +	echo '"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"' >>$@
> +

This looks OK to me, FWIW in the version I have on my branch I tried to
munge some of this a bit more. So the diff between my (-)/yours (+) is:
	
	--- po/fo.po    2022-05-19 12:23:02.548459230 +0200
	+++ po/fo.po.jx 2022-05-19 12:22:50.608563768 +0200
	@@ -1,19454 +1,1224 @@
	+# Faroese translations for Git package.
	+# Copyright (C) 2022 THE Git'S COPYRIGHT HOLDER
	 # This file is distributed under the same license as the Git package.
	+# Automatically generated, 2022.
	+#
	 msgid ""
	 msgstr ""
	 "Project-Id-Version: Git\n"
	-"Last-Translator: make by the Makefile\n"
	-"Language-Team: Git Mailing List <git@xxxxxxxxxxxxxxx>\n"
	+"Report-Msgid-Bugs-To: Git Mailing List <git@xxxxxxxxxxxxxxx>\n"
	+"POT-Creation-Date: 2022-05-19 12:22+0200\n"
	+"PO-Revision-Date: 2022-05-19 12:22+0200\n"
	+"Last-Translator: Automatically generated\n"
	+"Language-Team: none\n"
	 "Language: fo\n"
	 "MIME-Version: 1.0\n"
	 "Content-Type: text/plain; charset=UTF-8\n"
	 "Content-Transfer-Encoding: 8bit\n"
	 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
	-"PO-Revision-Date: 2022-04-11 11:05+0200\n"

So yours has the "Faroese translations for Git package" (good), but I
also omitted/corrected some of the headers. See 72ed0c8b2e6 (i18n:
migrate to line-number-less i18n workflow, 2022-04-03) in my fork.

This version is also fine, but just in case you wanted to steal
something from it...




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux