Mercurial > projects > mde
view mde/mde.d @ 12:bff0d802cb7d
Implemented some internationalization support.
Implemented i18n.I18nTranslation class to load strings and descriptions from files (with unittest).
MTUnknownTypeException removed: its pointless since it's always ignored without even any message.
A few fixes to mde.mergetag.read.Reader regarding partial reading.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Fri, 22 Feb 2008 11:52:20 +0000 |
parents | b940f267419e |
children | 4608be19ebe2 |
line wrap: on
line source
/** Modular D Engine * * This module contains main(). */ module mde.mde; // Package imports import mde.init; import global = mde.global; import mde.events; import mde.scheduler; import mde.i18n; // greeting message import mde.exception; import mde.input.input; // External library imports import tango.core.Thread : Thread; // for sleep //import tango.io.Stdout; import tango.time.Clock; import tango.util.log.Log : Log, Logger; import derelict.sdl.sdl; int main() { //BEGIN Initialisation Logger logger = Log.getLogger ("mde.mde"); scope Init init; try { init = new Init(); // initialisation } catch (initException e) { logger.fatal ("Initialisation failed; error was:"); logger.fatal (e.msg); return 1; } global.input.addButtonCallback (cast(Input.inputID) 0x0u, delegate void(Input.inputID i, bool b) { if (b) { logger.info ("Quiting..."); global.run = false; } } ); //END Initialisation /* Log a greeting message. Just a little test really, but it can stay until i18n finds a proper use. */ I18nTranslation transl = I18nTranslation.load ("mde"); logger.info (transl.getEntry ("greeting")); while (global.run) { Scheduler.run (Clock.now()); Thread.sleep (0.050); // sleep this many seconds } return 0; // cleanup handled by init's DTOR }