diff mbox series

[4/4] po: adjust README to code

Message ID e163c87b3efc1571cb3657df6459583af92f9f2b.1660828108.git.git@grubix.eu (mailing list archive)
State New, archived
Headers show
Series sequencer: clarify translations | expand

Commit Message

Michael J Gruber Aug. 18, 2022, 1:13 p.m. UTC
When we talk about sequencer action names as such (as opposed to command
names) we do translate the action name. Adjust the po README to reflect
this and to match the code base.

Signed-off-by: Michael J Gruber <git@grubix.eu>
---
 po/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ævar Arnfjörð Bjarmason Aug. 18, 2022, 3:03 p.m. UTC | #1
On Thu, Aug 18 2022, Michael J Gruber wrote:

> When we talk about sequencer action names as such (as opposed to command
> names) we do translate the action name. Adjust the po README to reflect
> this and to match the code base.
>
> Signed-off-by: Michael J Gruber <git@grubix.eu>
> ---
>  po/README.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/po/README.md b/po/README.md
> index 3e4f897d93..90b8455401 100644
> --- a/po/README.md
> +++ b/po/README.md
> @@ -273,7 +273,7 @@ General advice:
>  
>    ```c
>    /* TRANSLATORS: %s will be "revert" or "cherry-pick" */
> -  die(_("%s: Unable to write new index file"), action_name(opts));
> +  die(_("%s: Unable to write new index file"), _(action_name(opts)));
>    ```
>  
>  We provide wrappers for C, Shell and Perl programs. Here's how they're

Is the end-state of this series such that we do that anywhere? Perhaps
that's OK for an isolated fix, but it would really be preferred to avoid
the "lego" with:

	die(action == REVERT ? _("revert: Unable to write new index file") : ...);

Or whatever.

The "TRANSLATORS" comment above the example you're modifying is now
inaccurate, the "%s" will *not* be "revert" or "cherry-pick" in the
post-image.

I think the right thing here would be to grep our source for TRANSLATORS
comments that mention %s and replace this existing example with an
entirely different one...
Junio C Hamano Aug. 18, 2022, 8:36 p.m. UTC | #2
Michael J Gruber <git@grubix.eu> writes:

> When we talk about sequencer action names as such (as opposed to command
> names) we do translate the action name. Adjust the po README to reflect
> this and to match the code base.
>
> Signed-off-by: Michael J Gruber <git@grubix.eu>
> ---
>  po/README.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/po/README.md b/po/README.md
> index 3e4f897d93..90b8455401 100644
> --- a/po/README.md
> +++ b/po/README.md
> @@ -273,7 +273,7 @@ General advice:
>  
>    ```c
>    /* TRANSLATORS: %s will be "revert" or "cherry-pick" */
> -  die(_("%s: Unable to write new index file"), action_name(opts));
> +  die(_("%s: Unable to write new index file"), _(action_name(opts)));
>    ```

While "revert" and "cherry-pick" may have localized words in our po/
dictionary, the message uses "%s:" placeholder to identify the Git
operation that is reporting the problem, and the way the end-user
who is getting the message triggered the Git operation was by
running a subcommand of "git", isn't it?  

Isn't it confusing for a user who typed "git revert" to see an error
from _("revert")?  _("Unable to write new index file") is perfectly
fine, though.
diff mbox series

Patch

diff --git a/po/README.md b/po/README.md
index 3e4f897d93..90b8455401 100644
--- a/po/README.md
+++ b/po/README.md
@@ -273,7 +273,7 @@  General advice:
 
   ```c
   /* TRANSLATORS: %s will be "revert" or "cherry-pick" */
-  die(_("%s: Unable to write new index file"), action_name(opts));
+  die(_("%s: Unable to write new index file"), _(action_name(opts)));
   ```
 
 We provide wrappers for C, Shell and Perl programs. Here's how they're