diff options
author | Christ van Willegen <cvwillegen@gmail.com> | 2024-06-20 23:41:59 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-06-20 23:41:59 +0200 |
commit | ce0ef910df837b9b961f007a0a35064cad85188b (patch) | |
tree | bd8b18ad704b6166904c78b706b1a4e359e3124b /runtime/doc/builtin.txt | |
parent | f7f8f0b76dc6a3bf5d51825db65245221e5d265e (diff) |
patch 9.1.0509: not possible to translate Vim script messagesv9.1.0509
Problem: not possible to translate Vim script messages
(RestorerZ)
Solution: implement bindtextdomain() and gettext() to support Vim script
message translations (Christ van Willegen)
fixes: #11637
closes: #12447
Signed-off-by: Christ van Willegen <cvwillegen@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r-- | runtime/doc/builtin.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c1dd26020a..34c0b0a673 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 19 +*builtin.txt* For Vim version 9.1. Last change: 2024 Jun 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -67,6 +67,8 @@ autocmd_get([{opts}]) List return a list of autocmds balloon_gettext() String current text in the balloon balloon_show({expr}) none show {expr} inside the balloon balloon_split({msg}) List split {msg} as used for a balloon +bindtextdomain({package}, {path}) + none bind text domain to specied path blob2list({blob}) List convert {blob} into a list of numbers browse({save}, {title}, {initdir}, {default}) String put up a file requester @@ -277,7 +279,8 @@ gettabvar({nr}, {varname} [, {def}]) gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) any {name} in {winnr} in tab page {tabnr} gettagstack([{nr}]) Dict get the tag stack of window {nr} -gettext({text}) String lookup translation of {text} +gettext({text} [, {package}]) + String lookup translation of {text} getwininfo([{winid}]) List list of info about each window getwinpos([{timeout}]) List X and Y coord in pixels of Vim window getwinposx() Number X coord in pixels of the Vim window @@ -1218,6 +1221,13 @@ balloon_split({msg}) *balloon_split()* Return type: list<any> or list<string> +bindtextdomain({package}, {path}) *bindtextdomain()* + Bind a specific {package} to a {path} so that the + |gettext()| function can be used to get language-specific + translations for a package. {path} is the directory name + for the translations. See |package-create|. + + Return type: none blob2list({blob}) *blob2list()* Return a List containing the number value of each byte in Blob @@ -4978,7 +4988,7 @@ gettagstack([{winnr}]) *gettagstack()* Return type: dict<any> -gettext({text}) *gettext()* +gettext({text} [, {package}]) *gettext()* Translate String {text} if possible. This is mainly for use in the distributed Vim scripts. When generating message translations the {text} is extracted by @@ -4988,6 +4998,9 @@ gettext({text}) *gettext()* For {text} double quoted strings are preferred, because xgettext does not understand escaping in single quoted strings. + When the {package} is specified, the translation is looked up + for that specific package. You need to specify the path to + look for translations with the |bindtextdomain()| function. Return type: |String| |