From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Vasco Almeida <vascomalmeida@sapo.pt>
Cc: Git <git@vger.kernel.org>, Jiang Xin <worldhello.net@gmail.com>
Subject: Re: [PATCH 14/21] i18n: rebase-interactive: mark strings for translation
Date: Sat, 21 May 2016 14:57:17 +0200 [thread overview]
Message-ID: <CACBZZX7T7b9xMM_mDcH6JBnuCap7RtKvSYoFNDrN5mLdmLLYHQ@mail.gmail.com> (raw)
In-Reply-To: <1463585274-9027-15-git-send-email-vascomalmeida@sapo.pt>
On Wed, May 18, 2016 at 5:27 PM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:
> Mark strings in git-rebase--interactive.sh for translation. There is no
> need to source git-sh-i18n since git-rebase.sh already does so.
Cool, thanks for working on this.
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -128,7 +128,7 @@ mark_action_done () {
> if test "$last_count" != "$new_count"
> then
> last_count=$new_count
> - printf "Rebasing (%d/%d)\r" $new_count $total
> + printf "$(gettext Rebasing) (%d/%d)\r" $new_count $total
> test -z "$verbose" || echo
> fi
> }
Things like these should be converted into something you can pass to
eval_gettext. I.e. For any message the translator needs to be able to
translate the whole message. Consider e.g. RTL languages where the
(%d/%d) will be on the right-hand-side of the message.
> @@ -201,11 +201,13 @@ exit_with_patch () {
> make_patch $1
> git rev-parse --verify HEAD > "$amend"
> gpg_sign_opt_quoted=${gpg_sign_opt:+$(git rev-parse --sq-quote "$gpg_sign_opt")}
> - warn "You can amend the commit now, with"
> + # TRANSLATORS: after this line is a command to be issued by the user
> + warn "$(gettext "You can amend the commit now, with")"
> warn
> warn " git commit --amend $gpg_sign_opt_quoted"
> warn
> - warn "Once you are satisfied with your changes, run"
> + # TRANSLATORS: after this line is a command to be issued by the user
> + warn "$(gettext "Once you are satisfied with your changes, run")"
> warn
> warn " git rebase --continue"
> warn
Stuff like this should be one big call to gettext. I.e. everything
from "You can amend" up to and including "--continue". Even if the
translators probably don't want to change the order here it helps a
lot to have the extra context. I.e. do it like ...
> @@ -536,10 +543,11 @@ do_next () {
> mark_action_done
> do_pick $sha1 "$rest"
> git commit --amend --no-post-rewrite ${gpg_sign_opt:+"$gpg_sign_opt"} || {
> - warn "Could not amend commit after successfully picking $sha1... $rest"
> - warn "This is most likely due to an empty commit message, or the pre-commit hook"
> - warn "failed. If the pre-commit hook failed, you may need to resolve the issue before"
> - warn "you are able to reword the commit."
> + warn "$(eval_gettext "\
> +Could not amend commit after successfully picking \$sha1... \$rest
> +This is most likely due to an empty commit message, or the pre-commit hook
> +failed. If the pre-commit hook failed, you may need to resolve the issue before
> +you are able to reword the commit.")"
> exit_with_patch $sha1 1
> }
... this! :)
> @@ -607,7 +615,7 @@ do_next () {
> x|"exec")
> read -r command rest < "$todo"
> mark_action_done
> - printf 'Executing: %s\n' "$rest"
> + printf "$(gettext Executing:) %s\n" "$rest"
> "${SHELL:-@SHELL_PATH@}" -c "$rest" # Actual execution
> status=$?
> # Run in subshell because require_clean_work_tree can die.
Ditto my first comment about the whole thing needing to be a call to
eval_gettext. I.e. also that " %s" part.
> - warn "You can fix the problem, and then run"
> + # TRANSLATORS: after this line is a command to be issued by the user
> + warn "$(gettext "You can fix the problem, and then run")"
> warn
> warn " git rebase --continue"
> warn
> @@ -630,9 +639,11 @@ do_next () {
> exit "$status"
> elif test "$dirty" = t
> then
> - warn "Execution succeeded: $rest"
> - warn "but left changes to the index and/or the working tree"
> - warn "Commit or stash your changes, and then run"
> + # TRANSLATORS: after these lines is a command to be issued by the user
> + warn "$(eval_gettext "\
> +Execution succeeded: \$rest
> +but left changes to the index and/or the working tree
> +Commit or stash your changes, and then run")"
> warn
> warn " git rebase --continue"
> warn
Both ditto the above. I.e. just include the command to be issued in
the message. Then you can also skip the TRANSLATORS comment since this
won't be confusing to them anymore.
> @@ -991,28 +1002,26 @@ check_todo_list () {
> then
> test "$check_level" = error && raise_error=t
>
> - warn "Warning: some commits may have been dropped" \
> - "accidentally."
> - warn "Dropped commits (newer to older):"
> + warn "$(gettext "\
> +Warning: some commits may have been dropped accidentally.
> +Dropped commits (newer to older):")"
>
> # Make the list user-friendly and display
> opt="--no-walk=sorted --format=oneline --abbrev-commit --stdin"
> git rev-list $opt <"$todo".miss | warn_lines
>
> - warn "To avoid this message, use \"drop\" to" \
> - "explicitly remove a commit."
> - warn
> - warn "Use 'git config rebase.missingCommitsCheck' to change" \
> - "the level of warnings."
> - warn "The possible behaviours are: ignore, warn, error."
> + warn "$(gettext "\
> +To avoid this message, use \"drop\" to explicitly remove a commit.
> +
> +Use 'git config rebase.missingCommitsCheck' to change the level of warnings.
> +The possible behaviours are: ignore, warn, error.")"
> warn
> fi
> ;;
> ignore)
> ;;
> *)
Making this into one big eval_gettext where we stash away those "newer
to older" commits into a variable would be easier on translators, but
maybe there are performance considerations and we could just live with
two messages. Not sure how large this list might get in practice.
I haven't tried to apply & run this patch. But aside from the chunks I
commented on the rest of this looks fine to me.
next prev parent reply other threads:[~2016-05-21 12:57 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 15:27 [PATCH 00/21] i18n and tests updates Vasco Almeida
2016-05-18 15:27 ` [PATCH 01/21] i18n: builtin/remote.c: fix mark for translation Vasco Almeida
2016-05-18 15:27 ` [PATCH 02/21] i18n: advice: mark string about detached head " Vasco Almeida
2016-05-18 15:27 ` [PATCH 03/21] i18n: advice: internationalize message for conflicts Vasco Almeida
2016-05-18 19:24 ` Eric Sunshine
2016-05-18 21:00 ` Vasco Almeida
2016-05-18 21:31 ` Junio C Hamano
2016-05-18 15:27 ` [PATCH 04/21] i18n: transport: mark strings for translation Vasco Almeida
2016-05-18 15:27 ` [PATCH 05/21] i18n: sequencer: mark entire sentences " Vasco Almeida
2016-05-18 19:28 ` Eric Sunshine
2016-05-18 21:02 ` Vasco Almeida
2016-05-21 13:15 ` Ævar Arnfjörð Bjarmason
2016-05-23 0:44 ` Junio C Hamano
2016-05-23 1:00 ` Eric Sunshine
2016-05-18 15:27 ` [PATCH 06/21] i18n: sequencer: mark string " Vasco Almeida
2016-05-18 15:27 ` [PATCH 07/21] i18n: merge-octopus: mark messages " Vasco Almeida
2016-05-18 15:27 ` [PATCH 08/21] merge-octupus: use die shell function from git-sh-setup.sh Vasco Almeida
2016-05-18 15:27 ` [PATCH 09/21] i18n: rebase: fix marked string to use eval_gettext variant Vasco Almeida
2016-05-18 15:27 ` [PATCH 10/21] i18n: rebase: mark placeholder for translation Vasco Almeida
2016-05-18 15:27 ` [PATCH 11/21] i18n: bisect: simplify error message for i18n Vasco Almeida
2016-05-18 15:27 ` [PATCH 12/21] t6030: update to use test_i18ncmp Vasco Almeida
2016-05-18 15:27 ` [PATCH 13/21] i18n: git-sh-setup.sh: mark strings for translation Vasco Almeida
2016-05-18 15:27 ` [PATCH 14/21] i18n: rebase-interactive: " Vasco Almeida
2016-05-19 17:49 ` Eric Sunshine
2016-05-21 12:57 ` Ævar Arnfjörð Bjarmason [this message]
2016-05-21 14:05 ` Vasco Almeida
2016-05-18 15:27 ` [PATCH 15/21] i18n: rebase-interactive: mark here-doc " Vasco Almeida
2016-05-18 15:27 ` [PATCH 16/21] i18n: rebase-interactive: mark comments of squash " Vasco Almeida
2016-05-18 15:27 ` [PATCH 17/21] tests: use test_i18n* functions to suppress false positives Vasco Almeida
2016-05-18 15:27 ` [PATCH 18/21] tests: unpack-trees: update to use test_i18n* functions Vasco Almeida
2016-05-18 15:27 ` [PATCH 19/21] t9003: become resilient to GETTEXT_POISON Vasco Almeida
2016-05-19 18:34 ` Eric Sunshine
2016-05-19 21:31 ` Vasco Almeida
2016-05-20 3:30 ` Eric Sunshine
2016-05-20 16:39 ` Junio C Hamano
2016-05-20 17:22 ` Eric Sunshine
2016-05-20 17:39 ` Vasco Almeida
2016-05-20 17:50 ` Junio C Hamano
2016-05-20 17:59 ` Junio C Hamano
2016-05-20 18:21 ` Vasco Almeida
2016-05-18 15:27 ` [PATCH 20/21] t4153: fix negated test_i18ngrep call Vasco Almeida
2016-05-18 15:27 ` [PATCH 21/21] t5523: use test_i18ngrep for negation Vasco Almeida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACBZZX7T7b9xMM_mDcH6JBnuCap7RtKvSYoFNDrN5mLdmLLYHQ@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=vascomalmeida@sapo.pt \
--cc=worldhello.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).