Imported Upstream version 2.16.2
[platform/upstream/git.git] / git-sh-i18n.sh
index e6c3116..1ef1889 100644 (file)
@@ -53,6 +53,13 @@ gettext_without_eval_gettext)
                        git sh-i18n--envsubst "$1"
                )
        }
+
+       eval_ngettext () {
+               ngettext "$1" "$2" "$3" | (
+                       export PATH $(git sh-i18n--envsubst --variables "$2");
+                       git sh-i18n--envsubst "$2"
+               )
+       }
        ;;
 poison)
        # Emit garbage so that tests that incorrectly rely on translatable
@@ -64,6 +71,10 @@ poison)
        eval_gettext () {
                printf "%s" "# GETTEXT POISON #"
        }
+
+       eval_ngettext () {
+               printf "%s" "# GETTEXT POISON #"
+       }
        ;;
 *)
        gettext () {
@@ -76,6 +87,13 @@ poison)
                        git sh-i18n--envsubst "$1"
                )
        }
+
+       eval_ngettext () {
+               (test "$3" = 1 && printf "%s" "$1" || printf "%s" "$2") | (
+                       export PATH $(git sh-i18n--envsubst --variables "$2");
+                       git sh-i18n--envsubst "$2"
+               )
+       }
        ;;
 esac