{"thread":{"id":"31189","subject":"[PATCH] merge-recursive: add hint for translators in handle_change_delete()","startedAt":"2012-08-05T17:55:32Z","lastAt":"2012-08-06T19:07:58Z","messageCount":4,"participants":["Ralf Thielow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"196487","messageId":"1344189332-27082-1-git-send-email-ralf.thielow@gmail.com","threadId":"31189","inReplyTo":null,"subject":"[PATCH] merge-recursive: add hint for translators in handle_change_delete()","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2012-08-05T17:55:32Z","receivedAt":"2012-08-05T17:55:32Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"The outputs in handle_change_delete() contain a lot of placeholders.\nThis could end up in confusion to translators since two parts of them\nare translated separately. Add a hint for translators that they can\neasily understand it without study the code.\n\nSigned-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\nThis patch is based on a confusion on my own of the values of the\nreplacements. The first idea of Thomas was to remove the legos of\nthe static replacements. After thinking about and trying, it would\nend up in a lot more of lines in this function mainly caused by the\ndifferent outputs. It might be nicer to just add a hint for translators\nto describe the static replacements.\n\n merge-recursive.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 8903a73..7f661f2 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1035,6 +1035,9 @@ static void handle_change_delete(struct merge_options *o,\n \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n \t} else if (!a_sha) {\n \t\tif (!renamed) {\n+\t\t\t/* TRANSLATORS: The first %s will be \"rename\" or \"modify\",\n+ \t\t\t   the fourth %s will be \"renamed\" or \"modified\". These replacements\n+\t\t\t   are translated separately. This counts for the next four messages. */\n \t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n \t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n \t\t\t       change, path, o->branch1, change_past,\n-- \n1.7.12.rc1\n"},{"id":"196498","messageId":"7vwr1d2jje.fsf@alter.siamese.dyndns.org","threadId":"31189","inReplyTo":"1344189332-27082-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] merge-recursive: add hint for translators in handle_change_delete()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-05T20:03:33Z","receivedAt":"2012-08-05T20:03:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@gmail.com> writes:\n\n> The outputs in handle_change_delete() contain a lot of placeholders.\n> This could end up in confusion to translators since two parts of them\n> are translated separately. Add a hint for translators that they can\n> easily understand it without study the code.\n>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n> This patch is based on a confusion on my own of the values of the\n> replacements. The first idea of Thomas was to remove the legos of\n> the static replacements. After thinking about and trying, it would\n> end up in a lot more of lines in this function mainly caused by the\n> different outputs. It might be nicer to just add a hint for translators\n> to describe the static replacements.\n\nAnnotating only the first and then the fourth without explaining\nothers did not help me when I tried to guess what the message was\ntrying to say without looking at the variable names (which are not\ndirectly available to people who work on *.po files).\n\nI wonder something along this line to annotate all placeholders in\nthe order they appear might be easier to read:\n\n    /*\n     * TRANSLATORS: this message has many placeholders.\n     *\n     * CONFLICT (\n     * %s=<translation of noun \"rename\" or \"modify\">/delete):\n     * %s=<name of the path being merged> deleted in\n     * %s=<name of a branch> and\n     * %s=<translation of verb pp \"renamed\" or \"modified\"> in\n     * %s=<name of a branch>. Version\n     * %s=<name of a branch> of\n     * %s=<name of the path being merged> left in tree.\n     */\n\n\n\n>  merge-recursive.c | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/merge-recursive.c b/merge-recursive.c\n> index 8903a73..7f661f2 100644\n> --- a/merge-recursive.c\n> +++ b/merge-recursive.c\n> @@ -1035,6 +1035,9 @@ static void handle_change_delete(struct merge_options *o,\n>  \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n>  \t} else if (!a_sha) {\n>  \t\tif (!renamed) {\n> +\t\t\t/* TRANSLATORS: The first %s will be \"rename\" or \"modify\",\n> + \t\t\t   the fourth %s will be \"renamed\" or \"modified\". These replacements\n> +\t\t\t   are translated separately. This counts for the next four messages. */\n>  \t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n>  \t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n>  \t\t\t       change, path, o->branch1, change_past,\n"},{"id":"196553","messageId":"1344276224-11876-1-git-send-email-ralf.thielow@gmail.com","threadId":"31189","inReplyTo":"1344189332-27082-1-git-send-email-ralf.thielow@gmail.com","subject":"[PATCHv2] merge-recursive: add hint for translators in handle_change_delete()","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2012-08-06T18:03:44Z","receivedAt":"2012-08-06T18:03:44Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"The outputs in handle_change_delete() contain a lot of placeholders.\nThis could end up in confusion to translators. Add a hint for translators\nthat they can easily understand it without study the code.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\nThe first version did only explain the first and the\nfourth placeholder. Junio pointed out that the others\ncould still confuse translators. This second version\nexplains now all placeholders. It differs to Junio's\nsuggestion in a modified header and an optional part\nfor the other messages.\n\n merge-recursive.c | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 8903a73..ca58dcd 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1035,6 +1035,20 @@ static void handle_change_delete(struct merge_options *o,\n \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n \t} else if (!a_sha) {\n \t\tif (!renamed) {\n+\t\t\t/*\n+\t\t\t * TRANSLATORS: The next four messages have many\n+\t\t\t * placeholders.\n+\t\t\t *\n+\t\t\t * CONFLICT (\n+\t\t\t * %s=<translation of noun \"rename\" or \"modify\">/delete):\n+\t\t\t * %s=<name of the path being merged> deleted in\n+\t\t\t * %s=<name of a branch> and\n+\t\t\t * %s=<translation of verb pp \"renamed\" or \"modified\"> in\n+\t\t\t * %s=<name of a branch>. Version\n+\t\t\t * %s=<name of a branch> of\n+\t\t\t * %s=<name of the path being merged> left in tree[.][at\n+\t\t\t * %s=<name of the path beeing merged was renamed to>.]\n+\t\t\t */\n \t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n \t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n \t\t\t       change, path, o->branch1, change_past,\n-- \n1.7.12.rc1\n"},{"id":"196554","messageId":"7va9y7zvn5.fsf@alter.siamese.dyndns.org","threadId":"31189","inReplyTo":"1344276224-11876-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCHv2] merge-recursive: add hint for translators in handle_change_delete()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-06T19:07:58Z","receivedAt":"2012-08-06T19:07:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@gmail.com> writes:\n\n> The outputs in handle_change_delete() contain a lot of placeholders.\n> This could end up in confusion to translators. Add a hint for translators\n> that they can easily understand it without study the code.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n> The first version did only explain the first and the\n> fourth placeholder. Junio pointed out that the others\n> could still confuse translators. This second version\n> explains now all placeholders. It differs to Junio's\n> suggestion in a modified header and an optional part\n> for the other messages.\n>\n>  merge-recursive.c | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>\n> diff --git a/merge-recursive.c b/merge-recursive.c\n> index 8903a73..ca58dcd 100644\n> --- a/merge-recursive.c\n> +++ b/merge-recursive.c\n> @@ -1035,6 +1035,20 @@ static void handle_change_delete(struct merge_options *o,\n>  \t\tupdate_file(o, 0, o_sha, o_mode, renamed ? renamed : path);\n>  \t} else if (!a_sha) {\n>  \t\tif (!renamed) {\n> +\t\t\t/*\n> +\t\t\t * TRANSLATORS: The next four messages have many\n> +\t\t\t * placeholders.\n> +\t\t\t *\n> +\t\t\t * CONFLICT (\n> +\t\t\t * %s=<translation of noun \"rename\" or \"modify\">/delete):\n> +\t\t\t * %s=<name of the path being merged> deleted in\n> +\t\t\t * %s=<name of a branch> and\n> +\t\t\t * %s=<translation of verb pp \"renamed\" or \"modified\"> in\n> +\t\t\t * %s=<name of a branch>. Version\n> +\t\t\t * %s=<name of a branch> of\n> +\t\t\t * %s=<name of the path being merged> left in tree[.][at\n> +\t\t\t * %s=<name of the path beeing merged was renamed to>.]\n> +\t\t\t */\n>  \t\t\toutput(o, 1, _(\"CONFLICT (%s/delete): %s deleted in %s \"\n>  \t\t\t       \"and %s in %s. Version %s of %s left in tree.\"),\n>  \t\t\t       change, path, o->branch1, change_past,\n\nIn general, it is a poor strategy to carry already translated words\naround and insert them into messages to form translated sentences,\nso the way the translation is done for this part of the code needs\nto be rethought.\n\nBut without such a rewrite, I think this would be good enough\nband-aid.\n\nPeople experienced in i18n should look into a longer term solution,\nthough.\n\nThanks.\n"}]}