Mercurial > vim
comparison src/po/README.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 | dc766e1b0c95 |
children | aa91480771fe |
comparison
equal
deleted
inserted
replaced
21988:e3a2f5300336 | 21989:52e970719f4b |
---|---|
76 | 76 |
77 -- After you do this, you MUST do the next three steps! -- | 77 -- After you do this, you MUST do the next three steps! -- |
78 | 78 |
79 (2) Translate | 79 (2) Translate |
80 See the gettext documentation on how to do this. You can also find | 80 See the gettext documentation on how to do this. You can also find |
81 examples in the other po files. | 81 examples in the other po files. You can use "gF" on the file name to see |
82 the context of the message. | |
82 Search the po file for items that require translation: | 83 Search the po file for items that require translation: |
83 | 84 |
84 /fuzzy\|^msgstr ""\(\n"\)\@! | 85 /fuzzy\|^msgstr ""\(\n"\)\@! |
85 | 86 |
86 Remove the "#, fuzzy" line after adding the translation. | 87 Remove the "#, fuzzy" line after adding the translation. |
121 vim -S check.vim xx.po | 122 vim -S check.vim xx.po |
122 make xx.mo | 123 make xx.mo |
123 | 124 |
124 Look out for syntax errors and fix them. | 125 Look out for syntax errors and fix them. |
125 | 126 |
127 (6) Local tryout: | |
128 Vim normally picks up the .mo files from: | |
129 $VIMRUNTIME/lang/{lang}/LC_MESSAGES/vim.mo | |
130 To try out the messages with Vim use: | |
131 make tryoutinstall | |
132 And run Vim with $VIMRUNTIME set to ../runtime | |
133 | |
126 | 134 |
127 USING GETTEXT WITHOUT ICONV | 135 USING GETTEXT WITHOUT ICONV |
128 | 136 |
129 When using gettext which doesn't support iconv, the encoding of the .mo file | 137 When using gettext which doesn't support iconv, the encoding of the .mo file |
130 must match your active encoding. For that you must convert and change | 138 must match your active encoding. For that you must convert and change |