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 /core/apps/taboapp | |
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 | |||
@@ -11,7 +11,6 @@ | |||
11 | int main( int argc, char **argv ) | 11 | int main( int argc, char **argv ) |
12 | { | 12 | { |
13 | QPEApplication a( argc, argv ); | 13 | QPEApplication a( argc, argv ); |
14 | int ret = 0; | ||
15 | 14 | ||
16 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); | 15 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); |
17 | 16 | ||
@@ -30,10 +29,23 @@ int main( int argc, char **argv ) | |||
30 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 29 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); |
31 | 30 | ||
32 | QList<QWidget> list = iface->widgets(); | 31 | QList<QWidget> list = iface->widgets(); |
33 | |||
34 | QWidget *widget; | 32 | QWidget *widget; |
35 | for ( widget = list.first(); widget != 0; widget = list.next() ) | 33 | for ( widget = list.first(); widget != 0; widget = list.next() ) |
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 | } |
38 | } | 50 | } |
39 | 51 | ||