From: Stas Sergeev Date: Tue, 10 Oct 2006 17:09:07 +0000 (+0000) Subject: Enabled the gettext support. X-Git-Tag: 2.0~88 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=80a9f53a470b74014623901f67013b5be50a5552;p=super-star-trek.git Enabled the gettext support. However: 1. The path is hardcoded and suits *my* configuration. 2. It is still unclear how to build the translation catalog without automake. How can I solve these? --- diff --git a/src/sst.py b/src/sst.py index 17f4dab..d3047cd 100644 --- a/src/sst.py +++ b/src/sst.py @@ -179,13 +179,12 @@ more: the LRSCAN command is no longer needed. (Controlled by OPTION_AUTOSCAN and turned off if game type is "plain" or "almy".) """ -import os, sys, math, curses, time, readline, cPickle, random, copy +import os, sys, math, curses, time, readline, cPickle, random, copy, gettext SSTDOC = "/usr/share/doc/sst/sst.doc" DOC_NAME = "sst.doc" -# Stub to be replaced -def _(str): return str +def _(str): return gettext.gettext(str) PHASEFAC = 2.0 GALSIZE = 8 @@ -3305,6 +3304,8 @@ curwnd = None def iostart(): global stdscr, rows + gettext.bindtextdomain("sst", "/usr/local/share/locale") + gettext.textdomain("sst") if not (game.options & OPTION_CURSES): ln_env = os.getenv("LINES") if ln_env: