main.cpp
changeset 90 10f3d35dcbad
parent 89 9db3eaa21237
child 91 855c486b9360
     1.1 --- a/main.cpp	Tue Feb 08 14:07:19 2005 +0000
     1.2 +++ b/main.cpp	Sat Feb 19 17:14:33 2005 +0000
     1.3 @@ -1,6 +1,8 @@
     1.4  #include <qapplication.h>
     1.5  #include <qpixmap.h>
     1.6  #include <qtranslator.h>
     1.7 +#include <qdir.h>
     1.8 +#include <qtextcodec.h>
     1.9  
    1.10  #include "settings.h"
    1.11  #include "options.h"
    1.12 @@ -102,9 +104,17 @@
    1.13      QApplication app(argc,argv);
    1.14  
    1.15  
    1.16 +	// Use /usr/share/vym or /usr/local/share/vym or .
    1.17 +	QDir shareDir;
    1.18 +	shareDir.setPath ("/usr/share/vym");
    1.19 +	if (!shareDir.exists())
    1.20 +        shareDir.setPath ("/usr/local/share/vym");
    1.21 +	if (!shareDir.exists())
    1.22 +        shareDir.setPath(".");
    1.23 +
    1.24  	// Initialize translations
    1.25  	QTranslator translator (0);
    1.26 -	translator.load( "vym_de", "." );
    1.27 +	translator.load( QString("vym_")+QTextCodec::locale(), shareDir + "/lang");
    1.28      app.installTranslator( &translator );
    1.29  
    1.30  	// Initializing the row of system flags