Code

i18n: git-revert literal "me" messages
[git.git] / builtin / revert.c
index 1ca08da5eccc4aeeb3b92834bc58ae61b41d837f..b0a5ffb18b84a1600589f36f7f4cac662b2788c9 100644 (file)
@@ -302,11 +302,19 @@ static NORETURN void die_dirty_index(const char *me)
        if (read_cache_unmerged()) {
                die_resolve_conflict(me);
        } else {
-               if (advice_commit_before_merge)
-                       die("Your local changes would be overwritten by %s.\n"
-                           "Please, commit your changes or stash them to proceed.", me);
-               else
-                       die("Your local changes would be overwritten by %s.\n", me);
+               if (advice_commit_before_merge) {
+                       if (action == REVERT)
+                               die(_("Your local changes would be overwritten by revert.\n"
+                                         "Please, commit your changes or stash them to proceed."));
+                       else
+                               die(_("Your local changes would be overwritten by cherry-pick.\n"
+                                         "Please, commit your changes or stash them to proceed."));
+               } else {
+                       if (action == REVERT)
+                               die(_("Your local changes would be overwritten by revert.\n"));
+                       else
+                               die(_("Your local changes would be overwritten by cherry-pick.\n"));
+               }
        }
 }
 
@@ -354,7 +362,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
        if (active_cache_changed &&
            (write_cache(index_fd, active_cache, active_nr) ||
             commit_locked_index(&index_lock)))
-               die("%s: Unable to write new index file", me);
+               /* TRANSLATORS: %s will be "revert" or "cherry-pick" */
+               die(_("%s: Unable to write new index file"), me);
        rollback_lock_file(&index_lock);
 
        if (!clean) {
@@ -461,7 +470,9 @@ static int do_pick_commit(void)
                return fast_forward_to(commit->object.sha1, head);
 
        if (parent && parse_commit(parent) < 0)
-               die("%s: cannot parse parent commit %s",
+               /* TRANSLATORS: The first %s will be "revert" or
+                  "cherry-pick", the second %s a SHA1 */
+               die(_("%s: cannot parse parent commit %s"),
                    me, sha1_to_hex(parent->object.sha1));
 
        if (get_message(commit->buffer, &msg) != 0)