Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | TRANSLATING VIM MESSAGES |
| 2 | |
| 3 | This file explains how to create and maintain po files using |
| 4 | gnu-gettext.win32, a MINGW32 Windows port of gettext by Franco Bez |
| 5 | <franco.bez@gmx.de>. You can find it at: |
| 6 | |
| 7 | http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html |
| 8 | |
| 9 | First read the README.txt file for the general remarks |
| 10 | |
| 11 | |
| 12 | The file that does the work is Make_ming.mak in the po directory. It is an |
| 13 | adaptation of the Unix Makefile, but it does NOT test the presence of any po, |
| 14 | pot, or mo files, so use it at your own risk but with care: it could even kill |
| 15 | your canary. It has been tested by me several times (and with different |
| 16 | languages) with success. |
| 17 | |
| 18 | The make utility must be run from the po directory. |
| 19 | |
Bram Moolenaar | 3b0dd7c | 2010-08-01 14:36:59 +0200 | [diff] [blame] | 20 | First of all you must set the environment variable LANGUAGE to xx, where xx is |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 21 | the name of your language. You can do it from the command line or adding a |
| 22 | line to your autoexec.bat file: set LANGUAGE=xx. You must also add your |
| 23 | language to the Make_ming.mak file in the lines LANGUAGES, MOFILES, AND |
| 24 | POFILES. |
| 25 | |
| 26 | If you don't have a xx.po file, you must create it with the command: |
| 27 | |
| 28 | make -f Make_ming.mak first_time |
| 29 | |
| 30 | This will produce a new brand xx.po file with all the messages in Vim ready |
| 31 | for translation. Then you must source the cleanup.vim script from inside Vim; |
| 32 | it will comment the untranslated messages (now, all). I recommend to use |
| 33 | syntax highlighting so you can identify the untranslated messages easily. |
| 34 | You also must remove the '..\' that prepends the name of the source files. |
| 35 | (I don't no why, but make is unable to change the directory from po to src and |
| 36 | back to po, so all the work must be done from the po dir, hence the '..\') |
| 37 | |
| 38 | Then you must go step (2) below. |
| 39 | |
| 40 | If you are updating a po file you must follow the next steps (they are nearly |
| 41 | the same as in the Unix case, only the commands change): |
| 42 | |
| 43 | (1) Add new and changed messages from the Vim sources: |
| 44 | |
| 45 | make -f Make_ming.mak xx |
| 46 | |
| 47 | This will extract all the strings from Vim and merge them in with the |
| 48 | existing translations. Requires the GNU gettext utilities. Also requires |
| 49 | unpacking the extra archive. |
| 50 | Your original xx.po file will be copied to xx.po.orig |
| 51 | |
| 52 | -- After you do this, you MUST do the next three steps! -- |
| 53 | |
| 54 | (2) Translate |
| 55 | See the gettext documentation on how to do this. You can also find |
| 56 | examples in the other po files. |
| 57 | Search the po file for items that require translation: |
| 58 | /\#\~ and also the fuzzy translations, /\#, fuzzy |
| 59 | Remove "#~" and "#, fuzzy" after adding the translation. |
| 60 | |
| 61 | There is one special message: |
| 62 | msgid "Messages maintainer: Bram Moolenaar <Bram@vim.org>" |
| 63 | You should include your name and E-mail address instead, for example: |
| 64 | msgstr "Berichten übersetzt bei: John Doe <john@doe.org>" |
| 65 | |
| 66 | (3) Clean up |
| 67 | This is very important to make sure the translation works on all systems. |
| 68 | Comment-out all non-translated strings. There are two types: |
| 69 | - items marked with "#, fuzzy" |
| 70 | - items with an empty msgstr |
| 71 | You can do this with the cleanup.vim script: |
| 72 | |
| 73 | :source cleanup.vim |
| 74 | |
| 75 | (4) Check: |
| 76 | |
Bram Moolenaar | 58d9823 | 2005-07-23 22:25:46 +0000 | [diff] [blame] | 77 | vim -S check.vim xx.po |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 78 | make -f Make_ming.mak xx.mo |
| 79 | |
| 80 | Look out for syntax errors and fix them. |
| 81 | |
| 82 | (5) This is an extra step, ;-). If you want the vim.mo file installed in your |
| 83 | system you must run: |
| 84 | |
| 85 | make -f Make_ming.mak install |
| 86 | |
| 87 | This will create the xx\LC_MESSAGES directory (if it does not exist) and |
| 88 | will copy vim.po to it. |
| 89 | |
| 90 | (6) Another extra step ;-)). The command: |
| 91 | |
| 92 | make -f Make_ming.mak clean |
| 93 | |
| 94 | will delete the temp files created during the process. |
| 95 | |
| 96 | Suggestions will be welcomed. |
| 97 | |
| 98 | Eduardo F. Amatria <eferna1@platea.pntic.mec.es> |
| 99 | |
| 100 | Happy Vimming with NLS!! |
| 101 | |
| 102 | vim:tw=78: |