aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorEGRY Gabor <gaboregry1@t-online.hu>2008-01-11 17:52:07 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-01-28 17:14:39 -0500
commitc21a2d9589faa5599c9876bf0e0f48e81ee90284 (patch)
treed3b93c34740b1bb6119c139cfef6694035d00244 /scripts/kconfig
parent01771b0fef0f2cbff80e19295394ece2be1ab661 (diff)
kconfig: gettext support for xconfig
Full gettext support for xconfig. Signed-off-by: Egry Gabor <gaboregry1@t-online.hu> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Roman Zippel <zippel@linux-m68k.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/qconf.cc93
1 files changed, 49 insertions, 44 deletions
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index b9bb32dfd628..9fe27ca8a192 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -114,7 +114,7 @@ void ConfigItem::updateMenu(void)
114 114
115 sym = menu->sym; 115 sym = menu->sym;
116 prop = menu->prompt; 116 prop = menu->prompt;
117 prompt = QString::fromLocal8Bit(menu_get_prompt(menu)); 117 prompt = _(menu_get_prompt(menu));
118 118
119 if (prop) switch (prop->type) { 119 if (prop) switch (prop->type) {
120 case P_MENU: 120 case P_MENU:
@@ -208,7 +208,7 @@ void ConfigItem::updateMenu(void)
208 break; 208 break;
209 } 209 }
210 if (!sym_has_value(sym) && visible) 210 if (!sym_has_value(sym) && visible)
211 prompt += " (NEW)"; 211 prompt += _(" (NEW)");
212set_prompt: 212set_prompt:
213 setText(promptColIdx, prompt); 213 setText(promptColIdx, prompt);
214} 214}
@@ -346,7 +346,7 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
346 346
347 for (i = 0; i < colNr; i++) 347 for (i = 0; i < colNr; i++)
348 colMap[i] = colRevMap[i] = -1; 348 colMap[i] = colRevMap[i] = -1;
349 addColumn(promptColIdx, "Option"); 349 addColumn(promptColIdx, _("Option"));
350 350
351 reinit(); 351 reinit();
352} 352}
@@ -360,14 +360,14 @@ void ConfigList::reinit(void)
360 removeColumn(nameColIdx); 360 removeColumn(nameColIdx);
361 361
362 if (showName) 362 if (showName)
363 addColumn(nameColIdx, "Name"); 363 addColumn(nameColIdx, _("Name"));
364 if (showRange) { 364 if (showRange) {
365 addColumn(noColIdx, "N"); 365 addColumn(noColIdx, "N");
366 addColumn(modColIdx, "M"); 366 addColumn(modColIdx, "M");
367 addColumn(yesColIdx, "Y"); 367 addColumn(yesColIdx, "Y");
368 } 368 }
369 if (showData) 369 if (showData)
370 addColumn(dataColIdx, "Value"); 370 addColumn(dataColIdx, _("Value"));
371 371
372 updateListAll(); 372 updateListAll();
373} 373}
@@ -803,7 +803,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
803 QAction *action; 803 QAction *action;
804 804
805 headerPopup = new QPopupMenu(this); 805 headerPopup = new QPopupMenu(this);
806 action = new QAction(NULL, "Show Name", 0, this); 806 action = new QAction(NULL, _("Show Name"), 0, this);
807 action->setToggleAction(TRUE); 807 action->setToggleAction(TRUE);
808 connect(action, SIGNAL(toggled(bool)), 808 connect(action, SIGNAL(toggled(bool)),
809 parent(), SLOT(setShowName(bool))); 809 parent(), SLOT(setShowName(bool)));
@@ -811,7 +811,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
811 action, SLOT(setOn(bool))); 811 action, SLOT(setOn(bool)));
812 action->setOn(showName); 812 action->setOn(showName);
813 action->addTo(headerPopup); 813 action->addTo(headerPopup);
814 action = new QAction(NULL, "Show Range", 0, this); 814 action = new QAction(NULL, _("Show Range"), 0, this);
815 action->setToggleAction(TRUE); 815 action->setToggleAction(TRUE);
816 connect(action, SIGNAL(toggled(bool)), 816 connect(action, SIGNAL(toggled(bool)),
817 parent(), SLOT(setShowRange(bool))); 817 parent(), SLOT(setShowRange(bool)));
@@ -819,7 +819,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
819 action, SLOT(setOn(bool))); 819 action, SLOT(setOn(bool)));
820 action->setOn(showRange); 820 action->setOn(showRange);
821 action->addTo(headerPopup); 821 action->addTo(headerPopup);
822 action = new QAction(NULL, "Show Data", 0, this); 822 action = new QAction(NULL, _("Show Data"), 0, this);
823 action->setToggleAction(TRUE); 823 action->setToggleAction(TRUE);
824 connect(action, SIGNAL(toggled(bool)), 824 connect(action, SIGNAL(toggled(bool)),
825 parent(), SLOT(setShowData(bool))); 825 parent(), SLOT(setShowData(bool)));
@@ -1041,7 +1041,12 @@ void ConfigInfoView::menuInfo(void)
1041 if (showDebug()) 1041 if (showDebug())
1042 debug = debug_info(sym); 1042 debug = debug_info(sym);
1043 1043
1044 help = print_filter(_(menu_get_help(menu))); 1044 help = menu_get_help(menu);
1045 /* Gettextize if the help text not empty */
1046 if (help.isEmpty())
1047 help = print_filter(menu_get_help(menu));
1048 else
1049 help = print_filter(_(menu_get_help(menu)));
1045 } else if (menu->prompt) { 1050 } else if (menu->prompt) {
1046 head += "<big><b>"; 1051 head += "<big><b>";
1047 head += print_filter(_(menu->prompt->text)); 1052 head += print_filter(_(menu->prompt->text));
@@ -1167,7 +1172,7 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
1167QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos) 1172QPopupMenu* ConfigInfoView::createPopupMenu(const QPoint& pos)
1168{ 1173{
1169 QPopupMenu* popup = Parent::createPopupMenu(pos); 1174 QPopupMenu* popup = Parent::createPopupMenu(pos);
1170 QAction* action = new QAction(NULL,"Show Debug Info", 0, popup); 1175 QAction* action = new QAction(NULL, _("Show Debug Info"), 0, popup);
1171 action->setToggleAction(TRUE); 1176 action->setToggleAction(TRUE);
1172 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); 1177 connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
1173 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); 1178 connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
@@ -1189,11 +1194,11 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
1189 1194
1190 QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6); 1195 QVBoxLayout* layout1 = new QVBoxLayout(this, 11, 6);
1191 QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6); 1196 QHBoxLayout* layout2 = new QHBoxLayout(0, 0, 6);
1192 layout2->addWidget(new QLabel("Find:", this)); 1197 layout2->addWidget(new QLabel(_("Find:"), this));
1193 editField = new QLineEdit(this); 1198 editField = new QLineEdit(this);
1194 connect(editField, SIGNAL(returnPressed()), SLOT(search())); 1199 connect(editField, SIGNAL(returnPressed()), SLOT(search()));
1195 layout2->addWidget(editField); 1200 layout2->addWidget(editField);
1196 searchButton = new QPushButton("Search", this); 1201 searchButton = new QPushButton(_("Search"), this);
1197 searchButton->setAutoDefault(FALSE); 1202 searchButton->setAutoDefault(FALSE);
1198 connect(searchButton, SIGNAL(clicked()), SLOT(search())); 1203 connect(searchButton, SIGNAL(clicked()), SLOT(search()));
1199 layout2->addWidget(searchButton); 1204 layout2->addWidget(searchButton);
@@ -1313,58 +1318,58 @@ ConfigMainWindow::ConfigMainWindow(void)
1313 menu = menuBar(); 1318 menu = menuBar();
1314 toolBar = new QToolBar("Tools", this); 1319 toolBar = new QToolBar("Tools", this);
1315 1320
1316 backAction = new QAction("Back", QPixmap(xpm_back), "Back", 0, this); 1321 backAction = new QAction("Back", QPixmap(xpm_back), _("Back"), 0, this);
1317 connect(backAction, SIGNAL(activated()), SLOT(goBack())); 1322 connect(backAction, SIGNAL(activated()), SLOT(goBack()));
1318 backAction->setEnabled(FALSE); 1323 backAction->setEnabled(FALSE);
1319 QAction *quitAction = new QAction("Quit", "&Quit", CTRL+Key_Q, this); 1324 QAction *quitAction = new QAction("Quit", _("&Quit"), CTRL+Key_Q, this);
1320 connect(quitAction, SIGNAL(activated()), SLOT(close())); 1325 connect(quitAction, SIGNAL(activated()), SLOT(close()));
1321 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this); 1326 QAction *loadAction = new QAction("Load", QPixmap(xpm_load), _("&Load"), CTRL+Key_L, this);
1322 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig())); 1327 connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
1323 saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this); 1328 saveAction = new QAction("Save", QPixmap(xpm_save), _("&Save"), CTRL+Key_S, this);
1324 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig())); 1329 connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
1325 conf_set_changed_callback(conf_changed); 1330 conf_set_changed_callback(conf_changed);
1326 // Set saveAction's initial state 1331 // Set saveAction's initial state
1327 conf_changed(); 1332 conf_changed();
1328 QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this); 1333 QAction *saveAsAction = new QAction("Save As...", _("Save &As..."), 0, this);
1329 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs())); 1334 connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
1330 QAction *searchAction = new QAction("Find", "&Find", CTRL+Key_F, this); 1335 QAction *searchAction = new QAction("Find", _("&Find"), CTRL+Key_F, this);
1331 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig())); 1336 connect(searchAction, SIGNAL(activated()), SLOT(searchConfig()));
1332 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), "Split View", 0, this); 1337 QAction *singleViewAction = new QAction("Single View", QPixmap(xpm_single_view), _("Single View"), 0, this);
1333 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView())); 1338 connect(singleViewAction, SIGNAL(activated()), SLOT(showSingleView()));
1334 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), "Split View", 0, this); 1339 QAction *splitViewAction = new QAction("Split View", QPixmap(xpm_split_view), _("Split View"), 0, this);
1335 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView())); 1340 connect(splitViewAction, SIGNAL(activated()), SLOT(showSplitView()));
1336 QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), "Full View", 0, this); 1341 QAction *fullViewAction = new QAction("Full View", QPixmap(xpm_tree_view), _("Full View"), 0, this);
1337 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView())); 1342 connect(fullViewAction, SIGNAL(activated()), SLOT(showFullView()));
1338 1343