MacVim is not yet localized, but we all seem to agree that it should
be one day. If you don't know the word, localization is the process of
preparing an application to be translated to other languages.
Localizing MacVim consists of several parts:
1. The vim part needs to be localized. Luckily, this is already done
(see `:e $VIMRUNTIME/lang`). Some of the translations need some mac-
specific changes (for example, "File" Is translated to "Datei" on
Windows/Linux but to "Ablage" on OS X in German), but the localization
part is done.
2. Localize the MacVim part itself. MacVim contains a few strings on
itself, for example the "Quit?" warning you see when you hit ⌘Q when
you have several windows and/or tabs open. Also, there's the about
dialog and the prefs dialog. We need to decide if we want to translate
the prefs dialog by translating the nib file directly or by extracting
the strings, translating only them, and putting them into the nib at
load time. The former has the advantage that the GUI can be tweaked
for each language (english usually requires less room because all
words in english are very short). The latter has the advantage that
changing the GUI is much easier as there is only a single nib file,
not a nib file for each language.
3. The Vim<->MacVim communication needs to tell vim to actually use
the localized menu strings etc. Also, some places in MacVim's code
currently assume that stuff is english: For example, the file menu is
detected by checking if it's title is "File" and so on. This won't
work in a localized version (the usual workaround seems to grab the
menu that has an item bound to performClose:, which is usually the
target of File->Close). Same thing for the "Window" menu, and the
check for untitled windows checks for "No Name" in the title. And
keyboard handling needs to be changed bit too (currently, MacVim has
special case code for ⌘`, but other system languages use other
keyboard shortcuts to switch windows. See Bjorn's mail on this a few
days ago).
So, it'll probably take a while until MacVim is localized. The
attached patch grabs a low-hanging fruit: It wraps all user-visible
strings in NSLocalizedString(), so that they can be extracted with
`genstrings` and be translated (but translation has to wait until the
other problems outlined above are dealt with).
Nico
Nico,
Thanks both for the patch and for collecting all that info about
localization in one post. I have pushed the patch to the public repo.
Björn