Mercurial > vim
comparison runtime/doc/eval.txt @ 21989:52e970719f4b v8.2.1544
patch 8.2.1544: cannot translate messages in a Vim script
Commit: https://github.com/vim/vim/commit/0b39c3fd4c5d1c8ebd2efa85fced7df5e17efd3b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 30 15:52:10 2020 +0200
patch 8.2.1544: cannot translate messages in a Vim script
Problem: Cannot translate messages in a Vim script.
Solution: Add gettext(). Try it out for a few messages in the options
window.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 30 Aug 2020 16:00:04 +0200 |
parents | 85add08e6a2d |
children | bbca88cd13d5 |
comparison
equal
deleted
inserted
replaced
21988:e3a2f5300336 | 21989:52e970719f4b |
---|---|
2544 gettabvar({nr}, {varname} [, {def}]) | 2544 gettabvar({nr}, {varname} [, {def}]) |
2545 any variable {varname} in tab {nr} or {def} | 2545 any variable {varname} in tab {nr} or {def} |
2546 gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) | 2546 gettabwinvar({tabnr}, {winnr}, {name} [, {def}]) |
2547 any {name} in {winnr} in tab page {tabnr} | 2547 any {name} in {winnr} in tab page {tabnr} |
2548 gettagstack([{nr}]) Dict get the tag stack of window {nr} | 2548 gettagstack([{nr}]) Dict get the tag stack of window {nr} |
2549 gettext({text}) String lookup translation of {text} | |
2549 getwininfo([{winid}]) List list of info about each window | 2550 getwininfo([{winid}]) List list of info about each window |
2550 getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window | 2551 getwinpos([{timeout}]) List X and Y coord in pixels of the Vim window |
2551 getwinposx() Number X coord in pixels of the Vim window | 2552 getwinposx() Number X coord in pixels of the Vim window |
2552 getwinposy() Number Y coord in pixels of the Vim window | 2553 getwinposy() Number Y coord in pixels of the Vim window |
2553 getwinvar({nr}, {varname} [, {def}]) | 2554 getwinvar({nr}, {varname} [, {def}]) |
5825 See |tagstack| for more information about the tag stack. | 5826 See |tagstack| for more information about the tag stack. |
5826 | 5827 |
5827 Can also be used as a |method|: > | 5828 Can also be used as a |method|: > |
5828 GetWinnr()->gettagstack() | 5829 GetWinnr()->gettagstack() |
5829 | 5830 |
5831 | |
5832 gettext({text}) *gettext()* | |
5833 Translate {text} if possible. | |
5834 This is mainly for use in the distributed Vim scripts. When | |
5835 generating message translations the {text} is extracted by | |
5836 xgettext, the translator can add the translated message in the | |
5837 .po file and Vim will lookup the translation when gettext() is | |
5838 called. | |
5839 For {text} double quoted strings are preferred, because | |
5840 xgettext does not understand escaping in single quoted | |
5841 strings. | |
5842 | |
5843 | |
5830 getwininfo([{winid}]) *getwininfo()* | 5844 getwininfo([{winid}]) *getwininfo()* |
5831 Returns information about windows as a |List| with Dictionaries. | 5845 Returns information about windows as a |List| with Dictionaries. |
5832 | 5846 |
5833 If {winid} is given Information about the window with that ID | 5847 If {winid} is given Information about the window with that ID |
5834 is returned, as a |List| with one item. If the window does not | 5848 is returned, as a |List| with one item. If the window does not |