patch 9.1.1064: not possible to use plural forms with gettext()
Problem: not possible to use plural forms with gettext()
Solution: implement ngettext() Vim script function (Christ van Willegen)
closes: #16561
Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 6f5219c..e222d7c 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -416,6 +416,8 @@
mode([{expr}]) String current editing mode
mzeval({expr}) any evaluate |MzScheme| expression
nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
+ngettext({single}, {plural}, {number}[, {domain}])
+ String translate text based on {number}
nr2char({expr} [, {utf8}]) String single char with ASCII/UTF-8 value {expr}
or({expr}, {expr}) Number bitwise OR
pathshorten({expr} [, {len}]) String shorten directory names in a path
@@ -7687,6 +7689,20 @@
Return type: |Number|
+ngettext({single}, {plural}, {number}[, {domain}) *ngettext()*
+ Return a string that contains the correct value for a
+ message based on the rules for plural form(s) in
+ a language. Examples: >
+ ngettext("File", "Files", 2) # returns "Files"
+<
+ Can be used as a |method|: >
+ 1->ngettext("File", "Files") # returns "File"
+<
+ See |gettext()| for information on the domain parameter.
+
+ Return type: |String|
+
+
nr2char({expr} [, {utf8}]) *nr2char()*
Return a string with a single character, which has the number
value {expr}. Examples: >