author | kergoth <kergoth> | 2003-05-13 21:06:17 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-05-13 21:06:17 (UTC) |
commit | f31e2ecd95aba951dc77d98f02b45cb1297046ac (patch) (unidiff) | |
tree | 2631fd833a0f28fb664f0b47e0c10f6e814c2281 | |
parent | f36387ff38fa08dd0bea4d1569f5ff0b88fcfb96 (diff) | |
download | opie-f31e2ecd95aba951dc77d98f02b45cb1297046ac.zip opie-f31e2ecd95aba951dc77d98f02b45cb1297046ac.tar.gz opie-f31e2ecd95aba951dc77d98f02b45cb1297046ac.tar.bz2 |
Load langs
-rw-r--r-- | core/apps/taboapp/main.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp index 497e29f..5f7f86c 100644 --- a/core/apps/taboapp/main.cpp +++ b/core/apps/taboapp/main.cpp | |||
@@ -13,3 +13,2 @@ int main( int argc, char **argv ) | |||
13 | QPEApplication a( argc, argv ); | 13 | QPEApplication a( argc, argv ); |
14 | int ret = 0; | ||
15 | 14 | ||
@@ -32,3 +31,2 @@ int main( int argc, char **argv ) | |||
32 | QList<QWidget> list = iface->widgets(); | 31 | QList<QWidget> list = iface->widgets(); |
33 | |||
34 | QWidget *widget; | 32 | QWidget *widget; |
@@ -36,2 +34,16 @@ int main( int argc, char **argv ) | |||
36 | tabwidget->addTab(widget, QString(*it), QString(*it)); | 34 | tabwidget->addTab(widget, QString(*it), QString(*it)); |
35 | |||
36 | QString lang = getenv( "LANG" ); | ||
37 | if (lang.isNull()) | ||
38 | lang = "en"; | ||
39 | QTranslator *trans = new QTranslator(qApp); | ||
40 | QString type = (*it).left( (*it).find(".") ); | ||
41 | if (type.left(3) == "lib") | ||
42 | type = type.mid(3); | ||
43 | type = type.right( type.find("lib") ); | ||
44 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
45 | if ( trans->load( tfn )) | ||
46 | qApp->installTranslator( trans ); | ||
47 | else | ||
48 | delete trans; | ||
37 | } | 49 | } |