]> git.lyx.org Git - lyx.git/blob - src/main.C
5ad62888982da5ffa1d546105c1e25f30381aaa0
[lyx.git] / src / main.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *          Copyright 1995 Matthias Ettrich
7  *          Copyright 1995-2001 The LyX Team.
8  *
9  * ====================================================== */
10
11 #include <config.h>
12
13 #include "lyx_main.h"
14 #include "gettext.h"
15 #include "LString.h"
16 #include "lyx_gui.h"
17 #include "support/filetools.h"
18 #include "support/os.h"
19 #include "frontends/GUIRunTime.h"
20
21
22 int main(int argc, char * argv[])
23 {
24         os::init(&argc, &argv);
25         int const val = GUIRunTime::initApplication(argc, argv);
26         if (val)
27                 return val;
28
29         // lyx_localedir is used by gettext_init() is we have
30         //   i18n support built-in
31         string lyx_localedir = GetEnvPath("LYX_LOCALEDIR");
32         if (lyx_localedir.empty())
33                 lyx_localedir = LOCALEDIR;
34
35         // initialize for internationalized version *EK*
36         locale_init();
37         gettext_init(lyx_localedir);
38
39         LyX lyx(&argc, argv);
40         return 0; // SUCCESS
41 }