How do I change some of the messages generated by the mush?

Submitted by javelin on Mon, 2012-02-13 19:59

How do I change some of the messages generated by the mush?

Two ways. If you don't mind changing the source code, you can find the line that generats the message you want to change, edit it, re-compile, and reboot the mush.
If you'd rather avoid doing that, you can take advantage of the support for translating messages into other languages to just customize a few. The directions below assume you're running the mush on a unix server and are logged into the mush account's shell in the base pennmush directory. If you're using Windows or Macintosh, you'll probably have to resort to the first option.
First, create an index of all the strings marked for translation by running 'make pennmush.pot'. That will create a file named pennmush.pot in the po/ subdirectory. cd to that directory, and 'cp pennmush.pot en.po'.
Then, using your favorite text editor, open the file en.po, and look for a line like 'msgid "The message you want to change"'. The next line will be 'msgstr ""'. Put the customized message in the double quotes. Save the file and exit the editor.
Next, you need to compile the translation file. Do this with 'LANG=mine make localized'. That done, you need to edit the restart script in the pennmush/game directory. A few lines into the file is a commented section titled Internationalization stuff. Below the comments (The lines starting with #'s), add this line: 'export LC_MESSAGES=en'.
Finally, @shutdown the mush (A full @shutdown, not a /reboot), and start it back up again with the restart script. If all goes well, you should see something in game/log/netmush.log about 'Setting messages locale to mine'. and will get the custom messages. If not, you probably have to fiddle more with your environment variables a bit. Try LANG or LC_ALL instead of LC_MESSAGES, for example. See the gettext documentation on the account for more information.

2002-Apr-25 7:37pm shawnw

A slight variation on the above is to create po/en.pox instead of po/en.po. In this approach, en.pox contains only those entries that you're changing from the default (so it may be a very short file).

After you've got en.pox, you can build en.po from it automatically by running "make en.po" in the po/ subdirectory. This will combine en.pox with the pennmush.pot template and produce en.po. Thereafter, follow Raev's instructions.

This is the approach that's used by Javelin to build the translation files that are actually distributed on the ftp site. Advantages of this approach are than when pennmush.pot gets updated, you can quickly rebuild a matching en.po, and you get to easily see which entries you've changed. A disadvantage is that you have to copy and paste the untranslated entries from pennmush.pot into en.pox and edit them, rather than having the whole file copied in one fell swoop.

2002-Dec-02 12:03pm dunemush