The purpose of this short guide is to help you
through the process of making a Language Pack for
Winamp.
A language allows you to view the
core * settings of Winamp
in a given language by providing a translated
version of the dialogs. Then when Winamp is
loaded, it will use the translated versions of
the menus, dialogs, etc in place of the standard
English US interface.
* this means that you cannot
alter the language of the plugins that ship with
Winamp with a language pack
To make a language pack you will need the
following files (all of which can be found in the
Winamp SDK).
- resource.h - defines the ID for menus,
dialogs, etc
- main.c - required to create a valid
dll
- resource.hm - needed by main.rc
- main.rc - main file which holds text to
translate of menus and dialogs
- tips.txt - keyboard shortcut information
file which needs to be translated
Then you will need a C/C++ compiler capable of
generating a resource dll (a MSVC 6 project is
supplied in the SDK though it should be easy to
build the file in other compilers).
When building the language file, it's
recommended to build it in 'Release' mode
otherwise you may get build errors.
[ This is the case for MSVC and due to this the
included project file has had the 'Debug' build
mode removed. ]
The two files to be concerned about are
main.rc and
tips.txt. With both of these
files, you can open them in your chosen text
editor and then change all relevant language
strings (main.rc) or text (tips.txt) into the
language required.
The tips.txt is just a plain text file and it
should be clear that you need to update all of
the text in that file.
With main.rc, it is still only a text file but
may appear to be a bit confusing and overwhelming
if you have never opened a resource file (which
is what the file is). The contents of the file
are just text, with different formatting that the
resource compiler in C/C++ can understand.
For example with a menu item, it is specified as
follows:
MENUITEM "About &Winamp...", WINAMP_HELP_ABOUT
So to alter the language for this menu item,
you just have to alter the "About
&Winamp...", nothing else (otherwise
the file may not compile correctly).
With the main.rc file, if you want to use "
(double quote) then you need to put it into the
file as \". This is due to the way that C/C++
compilers deal with "s (double quotes) since they
are used to indicate the start and end of a text
string.
Once the files have been translated, then the
language pack files need to be compiled into a
resource dll. To be recognised by Winamp, the
final compiled file will need to have an
extension of lng e.g.
English.lng.
How you compile the files will be based on your
given compiler which you'll need to check the
documentation of to determine how to build the
file correctly with the given files (or if you
are using MSVC, then just use the project file
that comes with the SDK).
Once the file has been made, you need to copy
it into your Winamp directory (where winamp.exe
is). Then startup Winamp and select the language
and then allow Winamp to reboot for the new file
to be loaded.
Then you need to go through and check that the
file is fine, altering things if necessary and
rebuilding the language pack so it all fits
correctly on the dialog pages (though if you've
the knowledge then you could always alter the
position / sizes of the controls to give you some
more space but i won't go into that here).
Once you're happy with your language pack, the
next thing to do is to submit
it to winamp.com. For this
you will need to package the file in an installer
and provide some extra information and files
(more details can be found during the submission
process). Then sit back and wait for the pack to
be released (as long as it passes the submission
checks).
Happy translating!
by Darren Owen aka DrO (30/07/2004 -
rev #2)
|