This repository has been archived by the owner on Jan 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
I18N
82 lines (63 loc) · 3.73 KB
/
I18N
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
============================================================================
Internationalization in PennMUSH
============================================================================
PennMUSH 1.7.3 and later have extensive support for running in non-English
environments. There are two parts to this. First, what the mush considers
to be valid characters, what's upper-case, what's lower-case, how they
are sorted, and so on. The second is translating the messages produced
by the game into another language. (Helpfiles aren't currently translated.)
Several languages are currently supported to one degree or another.
If your favorite language isn't (or if you want to increase the
level of support), and you're fluent in it, you can help out!
See http://javelin.pennmush.org/translation.html.
Localization (the process of making a MUSH conform to a given "locale")
is controlled by the LANG or LC_ALL environment variables, which have
the form "la_DI", where la is a language code and DI is a dialect. For
example, "en_US" stands for English, United States dialect. The
language codes are usually the same as a country's top level domain in
URLs. Spanish is 'es', Russian is 'ru', and so on.
You need to have appropriate locale files installed in your operating
system to have everything work right (specifically, to get the
right character sets). How you do this is system-specific; Unix/linux
users should start with 'man -k locale' to find their system
commands (often 'man locale' or 'man local-gen' will be helpful).
There are two places where you have to use LANG: when you're
compiling the MUSH (in order to compile the message translation files)
and when you start up the MUSH (in order to set the locale for
the running server).
1. Compiling the MUSH - tips
Files with messages for translation are included with the source
code in pennmush/po; they have the .pox extension. You can get
the very latest versions of these files from the PennMUSH svn repository.
These files have to be compiled to an efficient internal form before
starting up the mush. This means you should set your LANG environment
variable before you compile your server.
To do this using the common bash shell, 'export LANG=en_US', or whatever
your setting is. If that gives an error, try the tcsh shell form 'setenv
LANG en_US'. If that still doesn't work, consult the documentation for
the shell you're using.
The message files are compiled during the "make install" step, which runs
'make localized' in the the po directory. (Technically, a pox file for
your LANG is merged with po/pennmush.pot to produce a po file for your
LANG, and then that is compiled into po/<LANG>/LC_MESSAGES/pennmush.mo,
which is loaded by the server.)
Be sure that you compile with a COMPRESSION_TYPE (in options.h) that
is 8-bit clean so it will work properly with non-ASCII characters.
2. Starting up the MUSH - tips
The LANG environment variable that controls what language the mush
uses is normally set in the pennmush/game/restart script. There's an
example for using French in the script already that can be used as a
starting point.
Your server account might be set up with a non-english language as the
default. If so, and you don't set LANG in the restart script, that
default language will be used.
You may also wish to change the only_ascii_in_names config option in
mush.cnf, to allow accented characters in object names.
3. Development - tips
Generally, the rules that the devteam use to decide what strings
should be made translatable in the source code (tagged with T()) are:
- tag in-game messages (stuff shown to players) with T(), except:
- panic messages
- very technical output like @list alloc and @stats/table
- don't tag log messages with T()
- don't tag console messages with T()