Question

I'm using gvim on Windows and I'm trying to configure it for easy editing of po files- mainly I just want to generate an mo file in the same directory whenever I save.

Looking at po.vim it appears I can do this, but I'm not clear on how to setup this up.

I downloaded gettext for windows and looking at the po.vim page it looks like I can set its location with these variables:

Information about the translator and language team is supplied by two 
  global variables: 'g:po_translator' and 'g:po_lang_team'. They should 
  be defined in the ".vimrc" (UNIX) or "_vimrc" (Windows) file. If they 
  are not defined, the default values (descriptive strings) are put 
  instead. 

Now I have this in my _vimrc (the location of where I saved gettext):

let g:po_translator='C:\G_Drive\code\gettext\bin\msgfmt.exe'

When I save po files it still does not generate an mo file. Am I misunderstanding how this plugin works? How can hook up po.vim to msgfmt.exe to generate mo files when I save- if this is even possible? Also I'd rather not put msgfmt.exe in path.

Was it helpful?

Solution

The msgfmt commands in po.vim are hardcoded to the shell command msgfmt, which will therefore only work on Unix systems, not Windows.

Furthermore, the g:po_translator global variable is only used to set defaults for the TranslatorInfo which inserts your name and the name of the translation team in the header of your .po file. In other words, in this context "translator" means "the person who last translated the file."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top