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 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 in this directory for general remarks on |
| 10 | translating Vim messages. |
| 11 | |
| 12 | |
| 13 | SETUP |
| 14 | |
| 15 | Set the enviroment variable LANGUAGE to the language code for the language you |
| 16 | are translating Vim messages to. Languagde codes are typically two characters |
| 17 | and you can find a list of them at: |
| 18 | |
| 19 | http://www.geocities.com/click2speak/languages.html |
| 20 | |
| 21 | The LANGUAGE environment variable can be set from the command line, by adding |
| 22 | a line to your autoexec.bat file, or by defining a user variable from the |
| 23 | Advanced tab in the System control panel. |
| 24 | |
| 25 | Next, edit Make_mvc.mak so that GETTEXT_PATH points the binary directory of |
| 26 | the intallation. |
| 27 | |
| 28 | |
| 29 | CREATING A NEW TRANSLATION |
| 30 | |
| 31 | When creating a new translation you must add your language code to the |
| 32 | Make_mvc.mak file in the lines defining LANGUAGES and MOFILES. To create the |
| 33 | initial .po file for your language you must use the command: |
| 34 | |
| 35 | make -f make_mvc.mak first_time |
| 36 | |
| 37 | Note: You need to be in the po directory when using this makefile. |
| 38 | |
| 39 | Once you have your new .po file load it into Vim and source cleanup.vim, this |
| 40 | will convert untranslated messages to comments. If you have syntax |
| 41 | highlighting turned on then untranslated messages will stand out more easily. |
| 42 | |
| 43 | You will also need to edit the file names in the comments in the .po file. |
| 44 | You need to remove the absolute directory specification (which has the form |
| 45 | c:\vim61\src\). You can do this in Vim with the following command with the |
| 46 | appropriate directory specfication for where you have installed the Vim |
| 47 | source: |
| 48 | |
| 49 | %s/c:\\vim61\\src\\//g |
| 50 | |
| 51 | |
| 52 | UPDATING A TRANSLATION |
| 53 | |
| 54 | If there are new or changed messages in Vim that need translating, then the |
| 55 | first thing to do is merge them into the existing translations. This is done |
| 56 | with the following command: |
| 57 | |
| 58 | nmake -f Make_mvc.mak xx.po |
| 59 | |
| 60 | where xx is the langauge code for the language needing translations. The |
| 61 | original .po file is copied to xx.po.orig. |
| 62 | |
| 63 | |
| 64 | DOING THE TRANSLATION |
| 65 | |
| 66 | Now that you have a .po file you can do the translations for all messages that |
| 67 | need it. See README.txt for specific instructions. |
| 68 | |
| 69 | Once you have finished translating the messages you should make sure all |
| 70 | non-translated strings are commented out. This can be done by sourcing |
| 71 | cleanup.vim once again. |
| 72 | |
| 73 | |
| 74 | CHECKING THE TRANSLATION |
| 75 | |
| 76 | Check the translation with the following command: |
| 77 | |
| 78 | nmake -f make_mvc.mak xx.mo |
| 79 | |
| 80 | Correct any syntax errors reported. When there are no more errors, the |
| 81 | translation is ready to be installed. |
| 82 | |
| 83 | |
| 84 | INSTALLING THE TRANSLATION |
| 85 | |
| 86 | Install your translation with the following command: |
| 87 | |
| 88 | nmake -f make_mvc.mak install |
| 89 | |
| 90 | This will create the xx\LC_MESSAGES directory in runtime\lang if it does not |
| 91 | already exist. |
| 92 | |
| 93 | |
| 94 | vim:tw=78: |