diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-30 15:52:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-30 15:52:10 +0200 |
commit | 0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b (patch) | |
tree | 6d230d3ef3310ad4aa28801d3720d33c29a19a4b /runtime/doc/eval.txt | |
parent | 25859dd74cd5befe964627dc03b8369dfaebe837 (diff) |
patch 8.2.1544: cannot translate messages in a Vim scriptv8.2.1544
Problem: Cannot translate messages in a Vim script.
Solution: Add gettext(). Try it out for a few messages in the options
window.
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e0c8473038..f1b6992196 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2546,6 +2546,7 @@ 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} getwininfo([{winid}]) List list of info about each window getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window getwinposx() Number X coord in pixels of the Vim window @@ -5827,6 +5828,19 @@ gettagstack([{nr}]) *gettagstack()* Can also be used as a |method|: > GetWinnr()->gettagstack() + +gettext({text}) *gettext()* + Translate {text} if possible. + This is mainly for use in the distributed Vim scripts. When + generating message translations the {text} is extracted by + xgettext, the translator can add the translated message in the + .po file and Vim will lookup the translation when gettext() is + called. + For {text} double quoted strings are preferred, because + xgettext does not understand escaping in single quoted + strings. + + getwininfo([{winid}]) *getwininfo()* Returns information about windows as a |List| with Dictionaries. |