* [PATCH] merge-recursive: add hint for translators in handle_change_delete()
@ 2012-08-05 17:55 Ralf Thielow
2012-08-05 20:03 ` Junio C Hamano
2012-08-06 18:03 ` [PATCHv2] " Ralf Thielow
0 siblings, 2 replies; 4+ messages in thread
From: Ralf Thielow @ 2012-08-05 17:55 UTC (permalink / raw)
To: trast; +Cc: git, gitster, Ralf Thielow
The outputs in handle_change_delete() contain a lot of placeholders.
This could end up in confusion to translators since two parts of them
are translated separately. Add a hint for translators that they can
easily understand it without study the code.
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
This patch is based on a confusion on my own of the values of the
replacements. The first idea of Thomas was to remove the legos of
the static replacements. After thinking about and trying, it would
end up in a lot more of lines in this function mainly caused by the
different outputs. It might be nicer to just add a hint for translators
to describe the static replacements.
merge-recursive.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/merge-recursive.c b/merge-recursive.c
index 8903a73..7f661f2 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1035,6 +1035,9 @@ static void handle_change_delete(struct merge_options *o,
update_file(o, 0, o_sha, o_mode, renamed ? renamed : path);
} else if (!a_sha) {
if (!renamed) {
+ /* TRANSLATORS: The first %s will be "rename" or "modify",
+ the fourth %s will be "renamed" or "modified". These replacements
+ are translated separately. This counts for the next four messages. */
output(o, 1, _("CONFLICT (%s/delete): %s deleted in %s "
"and %s in %s. Version %s of %s left in tree."),
change, path, o->branch1, change_past,
--
1.7.12.rc1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] merge-recursive: add hint for translators in handle_change_delete()
2012-08-05 17:55 [PATCH] merge-recursive: add hint for translators in handle_change_delete() Ralf Thielow
@ 2012-08-05 20:03 ` Junio C Hamano
2012-08-06 18:03 ` [PATCHv2] " Ralf Thielow
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-08-05 20:03 UTC (permalink / raw)
To: Ralf Thielow; +Cc: trast, git
Ralf Thielow <ralf.thielow@gmail.com> writes:
> The outputs in handle_change_delete() contain a lot of placeholders.
> This could end up in confusion to translators since two parts of them
> are translated separately. Add a hint for translators that they can
> easily understand it without study the code.
>
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
> This patch is based on a confusion on my own of the values of the
> replacements. The first idea of Thomas was to remove the legos of
> the static replacements. After thinking about and trying, it would
> end up in a lot more of lines in this function mainly caused by the
> different outputs. It might be nicer to just add a hint for translators
> to describe the static replacements.
Annotating only the first and then the fourth without explaining
others did not help me when I tried to guess what the message was
trying to say without looking at the variable names (which are not
directly available to people who work on *.po files).
I wonder something along this line to annotate all placeholders in
the order they appear might be easier to read:
/*
* TRANSLATORS: this message has many placeholders.
*
* CONFLICT (
* %s=<translation of noun "rename" or "modify">/delete):
* %s=<name of the path being merged> deleted in
* %s=<name of a branch> and
* %s=<translation of verb pp "renamed" or "modified"> in
* %s=<name of a branch>. Version
* %s=<name of a branch> of
* %s=<name of the path being merged> left in tree.
*/
> merge-recursive.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 8903a73..7f661f2 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -1035,6 +1035,9 @@ static void handle_change_delete(struct merge_options *o,
> update_file(o, 0, o_sha, o_mode, renamed ? renamed : path);
> } else if (!a_sha) {
> if (!renamed) {
> + /* TRANSLATORS: The first %s will be "rename" or "modify",
> + the fourth %s will be "renamed" or "modified". These replacements
> + are translated separately. This counts for the next four messages. */
> output(o, 1, _("CONFLICT (%s/delete): %s deleted in %s "
> "and %s in %s. Version %s of %s left in tree."),
> change, path, o->branch1, change_past,
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCHv2] merge-recursive: add hint for translators in handle_change_delete()
2012-08-05 17:55 [PATCH] merge-recursive: add hint for translators in handle_change_delete() Ralf Thielow
2012-08-05 20:03 ` Junio C Hamano
@ 2012-08-06 18:03 ` Ralf Thielow
2012-08-06 19:07 ` Junio C Hamano
1 sibling, 1 reply; 4+ messages in thread
From: Ralf Thielow @ 2012-08-06 18:03 UTC (permalink / raw)
To: gitster; +Cc: trast, git, Ralf Thielow
The outputs in handle_change_delete() contain a lot of placeholders.
This could end up in confusion to translators. Add a hint for translators
that they can easily understand it without study the code.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
---
The first version did only explain the first and the
fourth placeholder. Junio pointed out that the others
could still confuse translators. This second version
explains now all placeholders. It differs to Junio's
suggestion in a modified header and an optional part
for the other messages.
merge-recursive.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/merge-recursive.c b/merge-recursive.c
index 8903a73..ca58dcd 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1035,6 +1035,20 @@ static void handle_change_delete(struct merge_options *o,
update_file(o, 0, o_sha, o_mode, renamed ? renamed : path);
} else if (!a_sha) {
if (!renamed) {
+ /*
+ * TRANSLATORS: The next four messages have many
+ * placeholders.
+ *
+ * CONFLICT (
+ * %s=<translation of noun "rename" or "modify">/delete):
+ * %s=<name of the path being merged> deleted in
+ * %s=<name of a branch> and
+ * %s=<translation of verb pp "renamed" or "modified"> in
+ * %s=<name of a branch>. Version
+ * %s=<name of a branch> of
+ * %s=<name of the path being merged> left in tree[.][at
+ * %s=<name of the path beeing merged was renamed to>.]
+ */
output(o, 1, _("CONFLICT (%s/delete): %s deleted in %s "
"and %s in %s. Version %s of %s left in tree."),
change, path, o->branch1, change_past,
--
1.7.12.rc1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] merge-recursive: add hint for translators in handle_change_delete()
2012-08-06 18:03 ` [PATCHv2] " Ralf Thielow
@ 2012-08-06 19:07 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-08-06 19:07 UTC (permalink / raw)
To: Ralf Thielow; +Cc: trast, git
Ralf Thielow <ralf.thielow@gmail.com> writes:
> The outputs in handle_change_delete() contain a lot of placeholders.
> This could end up in confusion to translators. Add a hint for translators
> that they can easily understand it without study the code.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
> ---
> The first version did only explain the first and the
> fourth placeholder. Junio pointed out that the others
> could still confuse translators. This second version
> explains now all placeholders. It differs to Junio's
> suggestion in a modified header and an optional part
> for the other messages.
>
> merge-recursive.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/merge-recursive.c b/merge-recursive.c
> index 8903a73..ca58dcd 100644
> --- a/merge-recursive.c
> +++ b/merge-recursive.c
> @@ -1035,6 +1035,20 @@ static void handle_change_delete(struct merge_options *o,
> update_file(o, 0, o_sha, o_mode, renamed ? renamed : path);
> } else if (!a_sha) {
> if (!renamed) {
> + /*
> + * TRANSLATORS: The next four messages have many
> + * placeholders.
> + *
> + * CONFLICT (
> + * %s=<translation of noun "rename" or "modify">/delete):
> + * %s=<name of the path being merged> deleted in
> + * %s=<name of a branch> and
> + * %s=<translation of verb pp "renamed" or "modified"> in
> + * %s=<name of a branch>. Version
> + * %s=<name of a branch> of
> + * %s=<name of the path being merged> left in tree[.][at
> + * %s=<name of the path beeing merged was renamed to>.]
> + */
> output(o, 1, _("CONFLICT (%s/delete): %s deleted in %s "
> "and %s in %s. Version %s of %s left in tree."),
> change, path, o->branch1, change_past,
In general, it is a poor strategy to carry already translated words
around and insert them into messages to form translated sentences,
so the way the translation is done for this part of the code needs
to be rethought.
But without such a rewrite, I think this would be good enough
band-aid.
People experienced in i18n should look into a longer term solution,
though.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-06 19:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-05 17:55 [PATCH] merge-recursive: add hint for translators in handle_change_delete() Ralf Thielow
2012-08-05 20:03 ` Junio C Hamano
2012-08-06 18:03 ` [PATCHv2] " Ralf Thielow
2012-08-06 19:07 ` Junio C Hamano
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).