Added i18n support through gettext to the Qt4 version

sensor-dev
Vincent Giangiulio 2010-04-13 10:14:57 +00:00
parent f591ba4f55
commit 54892743b8
21 changed files with 709 additions and 680 deletions

View File

@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Chris Laurel
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS = chris@teyssier.org
MSGID_BUGS_ADDRESS = celestia-developers@lists.sourceforge.net
# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.

View File

@ -1,121 +1,132 @@
# Source
src/celengine/asterism.cpp
src/celengine/astro.cpp
src/celengine/axisarrow.cpp
src/celengine/body.cpp
src/celengine/boundaries.cpp
src/celengine/catalogxref.cpp
src/celengine/cmdparser.cpp
src/celengine/command.cpp
src/celengine/console.cpp
src/celengine/dds.cpp
src/celengine/deepskyobj.cpp
src/celengine/dispmap.cpp
src/celengine/dsodb.cpp
src/celengine/execution.cpp
src/celengine/fragmentprog.cpp
src/celengine/frame.cpp
src/celengine/galaxy.cpp
src/celengine/glcontext.cpp
src/celengine/globular.cpp
src/celengine/glshader.cpp
src/celengine/image.cpp
src/celengine/location.cpp
src/celengine/lodspheremesh.cpp
src/celengine/marker.cpp
src/celengine/mesh.cpp
src/celengine/meshmanager.cpp
src/celengine/model.cpp
src/celengine/modelfile.cpp
src/celengine/multitexture.cpp
src/celengine/nebula.cpp
src/celengine/observer.cpp
src/celengine/opencluster.cpp
src/celengine/overlay.cpp
src/celengine/parseobject.cpp
src/celengine/parser.cpp
src/celengine/particlesystem.cpp
src/celengine/particlesystemfile.cpp
src/celengine/planetgrid.cpp
src/celengine/regcombine.cpp
src/celengine/rendcontext.cpp
src/celengine/render.cpp
src/celengine/renderglsl.cpp
src/celengine/rotationmanager.cpp
src/celengine/selection.cpp
src/celengine/shadermanager.cpp
src/celengine/simulation.cpp
src/celengine/skygrid.cpp
src/celengine/solarsys.cpp
src/celengine/spheremesh.cpp
src/celengine/starbrowser.cpp
src/celengine/starcolors.cpp
src/celengine/star.cpp
src/celengine/stardb.cpp
src/celengine/starname.cpp
src/celengine/staroctree.cpp
src/celengine/stellarclass.cpp
src/celengine/texmanager.cpp
src/celengine/texture.cpp
src/celengine/tokenizer.cpp
src/celengine/trajmanager.cpp
src/celengine/univcoord.cpp
src/celengine/universe.cpp
src/celengine/vertexlist.cpp
src/celengine/vertexprog.cpp
src/celengine/virtualtex.cpp
src/celengine/visibleregion.cpp
src/celestia/celestiacore.cpp
src/celestia/oggtheoracapture.cpp
src/celestia/url.cpp
src/celestia/win32/winmain.cpp
src/celestia/win32/windatepicker.cpp
src/celestia/win32/wineclipses.cpp
src/celestia/win32/winssbrowser.cpp
src/celestia/win32/winstarbrowser.cpp
src/celestia/win32/wintime.cpp
src/celutil/util.cpp
# Config
#po/celestia.cfg.pot
# Data
#po/solarsys.pot
#po/starnames.pot
#po/deepsky.pot
#po/asterisms.pot
# Extras
#po/apollo.pot
#po/minormoons.pot
src/celestia/kde/celestialbrowser.cpp
src/celestia/kde/celestialbrowser.h
src/celestia/kde/cellistviewitem.h
src/celestia/kde/eclipsefinderdlg.cpp
src/celestia/kde/eclipsefinderdlg.h
src/celestia/kde/kcelbookmarkmanager.cpp
src/celestia/kde/kcelbookmarkmanager.h
src/celestia/kde/kcelbookmarkmenu.cpp
src/celestia/kde/kcelbookmarkmenu.h
src/celestia/kde/kcelbookmarkowner.h
src/celestia/kde/kdeapp.cpp
src/celestia/kde/kdeapp.h
src/celestia/kde/kdeglwidget.cpp
src/celestia/kde/kdeglwidget.h
src/celestia/kde/kdemain.cpp
src/celestia/kde/kdepreferencesdialog.cpp
src/celestia/kde/kdepreferencesdialog.h
src/celestia/kde/kdeuniquecelestia.cpp
src/celestia/kde/kdeuniquecelestia.h
src/celestia/kde/selectionpopup.cpp
src/celestia/kde/selectionpopup.h
src/celestia/kde/videocapturedlg.cpp
src/celestia/kde/rc.cpp
data/data.cpp
src/celestia/win32/res/resource_strings.cpp
# Engine sources
src/celengine/asterism.cpp
src/celengine/astro.cpp
src/celengine/axisarrow.cpp
src/celengine/body.cpp
src/celengine/boundaries.cpp
src/celengine/catalogxref.cpp
src/celengine/cmdparser.cpp
src/celengine/command.cpp
src/celengine/console.cpp
src/celengine/dds.cpp
src/celengine/deepskyobj.cpp
src/celengine/dispmap.cpp
src/celengine/dsodb.cpp
src/celengine/execution.cpp
src/celengine/fragmentprog.cpp
src/celengine/frame.cpp
src/celengine/galaxy.cpp
src/celengine/glcontext.cpp
src/celengine/globular.cpp
src/celengine/glshader.cpp
src/celengine/image.cpp
src/celengine/location.cpp
src/celengine/lodspheremesh.cpp
src/celengine/marker.cpp
src/celengine/meshmanager.cpp
src/celengine/multitexture.cpp
src/celengine/nebula.cpp
src/celengine/observer.cpp
src/celengine/opencluster.cpp
src/celengine/overlay.cpp
src/celengine/parseobject.cpp
src/celengine/parser.cpp
src/celengine/particlesystem.cpp
src/celengine/particlesystemfile.cpp
src/celengine/planetgrid.cpp
src/celengine/regcombine.cpp
src/celengine/rendcontext.cpp
src/celengine/render.cpp
src/celengine/renderglsl.cpp
src/celengine/rotationmanager.cpp
src/celengine/selection.cpp
src/celengine/shadermanager.cpp
src/celengine/simulation.cpp
src/celengine/skygrid.cpp
src/celengine/solarsys.cpp
src/celengine/spheremesh.cpp
src/celengine/starbrowser.cpp
src/celengine/starcolors.cpp
src/celengine/star.cpp
src/celengine/stardb.cpp
src/celengine/starname.cpp
src/celengine/staroctree.cpp
src/celengine/stellarclass.cpp
src/celengine/texmanager.cpp
src/celengine/texture.cpp
src/celengine/tokenizer.cpp
src/celengine/trajmanager.cpp
src/celengine/univcoord.cpp
src/celengine/universe.cpp
src/celengine/vertexprog.cpp
src/celengine/virtualtex.cpp
src/celengine/visibleregion.cpp
# App sources
src/celestia/celestiacore.cpp
src/celestia/celx.cpp
src/celestia/oggtheoracapture.cpp
src/celestia/url.cpp
# Util sources
src/celutil/util.cpp
# Data sources
data/data.cpp
# Win32 sources
src/celestia/win32/res/resource_strings.cpp
src/celestia/win32/winmain.cpp
src/celestia/win32/windatepicker.cpp
src/celestia/win32/wineclipses.cpp
src/celestia/win32/winssbrowser.cpp
src/celestia/win32/winstarbrowser.cpp
src/celestia/win32/wintime.cpp
# KDE sources
src/celestia/kde/celestialbrowser.cpp
src/celestia/kde/eclipsefinderdlg.cpp
src/celestia/kde/kcelbookmarkmanager.cpp
src/celestia/kde/kcelbookmarkmenu.cpp
src/celestia/kde/kdeapp.cpp
src/celestia/kde/kdeglwidget.cpp
src/celestia/kde/kdemain.cpp
src/celestia/kde/kdepreferencesdialog.cpp
src/celestia/kde/kdeuniquecelestia.cpp
src/celestia/kde/selectionpopup.cpp
src/celestia/kde/videocapturedlg.cpp
src/celestia/kde/rc.cpp
# KDE headers
src/celestia/kde/celestialbrowser.h
src/celestia/kde/cellistviewitem.h
src/celestia/kde/eclipsefinderdlg.h
src/celestia/kde/kcelbookmarkmanager.h
src/celestia/kde/kcelbookmarkmenu.h
src/celestia/kde/kcelbookmarkowner.h
src/celestia/kde/kdeapp.h
src/celestia/kde/kdeglwidget.h
src/celestia/kde/kdepreferencesdialog.h
src/celestia/kde/kdeuniquecelestia.h
src/celestia/kde/selectionpopup.h
# Qt sources
src/celestia/qt/qtappwin.cpp
src/celestia/qt/qtbookmark.cpp
src/celestia/qt/qtcelestiaactions.cpp
src/celestia/qt/qtcelestialbrowser.cpp
src/celestia/qt/qtdeepskybrowser.cpp
src/celestia/qt/qteventfinder.cpp
src/celestia/qt/qtinfopanel.cpp
src/celestia/qt/qtpreferencesdialog.cpp
src/celestia/qt/qtselectionpopup.cpp
src/celestia/qt/qtsettimedialog.cpp
src/celestia/qt/qtsolarsystembrowser.cpp
src/celestia/qt/qttimetoolbar.cpp
src/celestia/qt/xbel.cpp
# Qt headers generated from reading UI files
src/celestia/qt/ui/ui_addbookmark.h
src/celestia/qt/ui/ui_newbookmarkfolder.h
src/celestia/qt/ui/ui_organizebookmarks.h
src/celestia/qt/ui/ui_preferences.h

View File

@ -20,8 +20,8 @@ use Encode;
use File::Basename;
my $dir = dirname $0;
my $resource_file = "$dir/../src/celestia/res/celestia.rc";
my $output_dir = "$dir/../src/celestia/res/";
my $resource_file = "$dir/../src/celestia/win32/res/celestia.rc";
my $output_dir = "$dir/../src/celestia/win32/res/";
opendir(DIR, $dir);
my @po_files = sort (grep( /\.po$/, readdir(DIR) ));
@ -88,8 +88,8 @@ foreach my $po (@po_files) {
open OUT, "> $output_dir/celestia_$lang.rc";
print OUT $res;
close OUT;
system qq{rc /l $lang{$lang}[0] /d "NDEBUG" /fo $dir\\..\\src\\celestia\\celestia_$lang.res /i "$dir\\..\\src\\celestia\\res" $dir\\..\\src\\celestia\\res\\celestia_$lang.rc};
system qq{link /nologo /noentry /dll /machine:I386 /out:$dir\\..\\locale\\res_$lang.dll $dir\\..\\src\\celestia\\celestia_$lang.res};
system qq{rc /l $lang{$lang}[0] /d "NDEBUG" /fo $dir\\..\\src\\celestia\\win32\\celestia_$lang.res /i "$dir\\..\\src\\celestia\\win32\\res" $dir\\..\\src\\celestia\\win32\\res\\celestia_$lang.rc};
system qq{link /nologo /noentry /dll /machine:I386 /out:$dir\\..\\locale\\res_$lang.dll $dir\\..\\src\\celestia\\win32\\celestia_$lang.res};
system qq{msgfmt $dir\\$lang.po -o $dir\\..\\locale\\$lang\\LC_MESSAGES\\celestia.mo};
}

View File

@ -1102,21 +1102,21 @@ bool LuaState::tick(double dt)
if (getTime() > timeout)
{
appCore->showText("WARNING:\n\nThis script requests permission to read/write files\n"
appCore->showText(_("WARNING:\n\nThis script requests permission to read/write files\n"
"and execute external programs. Allowing this can be\n"
"dangerous.\n"
"Do you trust the script and want to allow this?\n\n"
"y = yes, ESC = cancel script, any other key = no",
"y = yes, ESC = cancel script, any other key = no"),
0, 0,
-15, 5, 5);
appCore->setTextEnterMode(appCore->getTextEnterMode() | CelestiaCore::KbPassToScript);
}
else
{
appCore->showText("WARNING:\n\nThis script requests permission to read/write files\n"
appCore->showText(_("WARNING:\n\nThis script requests permission to read/write files\n"
"and execute external programs. Allowing this can be\n"
"dangerous.\n"
"Do you trust the script and want to allow this?",
"Do you trust the script and want to allow this?"),
0, 0,
-15, 5, 5);
appCore->setTextEnterMode(appCore->getTextEnterMode() & ~CelestiaCore::KbPassToScript);

View File

@ -194,7 +194,7 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
if (domain >= domainCount)
{
QMessageBox::critical(0, "Celestia",
tr("Celestia is unable to run because the CelestiaResources folder was not "
_("Celestia is unable to run because the CelestiaResources folder was not "
"found, probably due to improper installation."));
exit(1);
}
@ -232,7 +232,7 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
if (glewErr != GLEW_OK)
{
QMessageBox::critical(0, "Celestia",
tr("Celestia was unable to initialize OpenGL extensions (error %1). Graphics quality will be reduced.").arg(glewErr));
QString(_("Celestia was unable to initialize OpenGL extensions (error %1). Graphics quality will be reduced.")).arg(glewErr));
}
m_appCore->setCursorHandler(glWidget);
@ -250,7 +250,7 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
QTabWidget* tabWidget = new QTabWidget(this);
tabWidget->setObjectName("celestia-tabbed-browser");
toolsDock = new QDockWidget(tr("Celestial Browser"), this);
toolsDock = new QDockWidget(_("Celestial Browser"), this);
toolsDock->setObjectName("celestia-tools-dock");
toolsDock->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
@ -278,21 +278,21 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
// Set up the browser tabs
tabWidget->addTab(solarSystemBrowser, tr("Solar System"));
tabWidget->addTab(celestialBrowser, tr("Stars"));
tabWidget->addTab(deepSkyBrowser, tr("Deep Sky Objects"));
tabWidget->addTab(solarSystemBrowser, _("Solar System"));
tabWidget->addTab(celestialBrowser, _("Stars"));
tabWidget->addTab(deepSkyBrowser, _("Deep Sky Objects"));
toolsDock->setWidget(tabWidget);
addDockWidget(Qt::LeftDockWidgetArea, toolsDock);
infoPanel = new InfoPanel(tr("Info Browser"), this);
infoPanel = new InfoPanel(_("Info Browser"), this);
infoPanel->setObjectName("info-panel");
infoPanel->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
addDockWidget(Qt::RightDockWidgetArea, infoPanel);
infoPanel->setVisible(false);
eventFinder = new EventFinder(m_appCore, tr("Event Finder"), this);
eventFinder = new EventFinder(m_appCore, _("Event Finder"), this);
eventFinder->setObjectName("event-finder");
eventFinder->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
@ -301,14 +301,14 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
//addDockWidget(Qt::DockWidgetArea, eventFinder);
// Create the time toolbar
TimeToolBar* timeToolBar = new TimeToolBar(m_appCore, tr("Time"));
TimeToolBar* timeToolBar = new TimeToolBar(m_appCore, _("Time"));
timeToolBar->setObjectName("time-toolbar");
timeToolBar->setFloatable(true);
timeToolBar->setMovable(true);
addToolBar(Qt::TopToolBarArea, timeToolBar);
// Create the guides toolbar
QToolBar* guidesToolBar = new QToolBar(tr("Guides"));
QToolBar* guidesToolBar = new QToolBar(_("Guides"));
guidesToolBar->setObjectName("guides-toolbar");
guidesToolBar->setFloatable(true);
guidesToolBar->setMovable(true);
@ -358,9 +358,9 @@ void CelestiaAppWindow::init(const QString& qConfigFileName,
viewMenu->addAction(eventFinder->toggleViewAction());
viewMenu->addSeparator();
QAction* fullScreenAction = new QAction(tr("Full screen"), this);
QAction* fullScreenAction = new QAction(_("Full screen"), this);
fullScreenAction->setCheckable(true);
fullScreenAction->setShortcut(tr("Shift+F11"));
fullScreenAction->setShortcut(QString(_("Shift+F11")));
// Set the full screen check state only after reading settings
fullScreenAction->setChecked(isFullScreen());
@ -538,14 +538,14 @@ bool CelestiaAppWindow::loadBookmarks()
QString bookmarksFilePath = QDir(m_dataDirPath).filePath(BOOKMARKS_FILE);
if (!QFile::exists(bookmarksFilePath))
{
QMessageBox::warning(this, "No Bookmarks File", QString("Bookmarks file %1 does not exist.").arg(bookmarksFilePath));
QMessageBox::warning(this, _("No Bookmarks File"), QString(_("Bookmarks file %1 does not exist.")).arg(bookmarksFilePath));
}
else
{
QFile bookmarksFile(bookmarksFilePath);
if (!bookmarksFile.open(QIODevice::ReadOnly))
{
QMessageBox::warning(this, tr("Error opening bookmarks file"), bookmarksFile.errorString());
QMessageBox::warning(this, _("Error opening bookmarks file"), bookmarksFile.errorString());
}
else
{
@ -564,7 +564,7 @@ void CelestiaAppWindow::saveBookmarks()
QFile bookmarksFile(bookmarksFilePath);
if (!bookmarksFile.open(QIODevice::WriteOnly))
{
QMessageBox::warning(this, tr("Error Saving Bookmarks"), bookmarksFile.errorString());
QMessageBox::warning(this, _("Error Saving Bookmarks"), bookmarksFile.errorString());
}
else
{
@ -606,9 +606,9 @@ void CelestiaAppWindow::slotGrabImage()
}
QString saveAsName = QFileDialog::getSaveFileName(this,
tr("Save Image"),
_("Save Image"),
dir,
tr("Images (*.png *.jpg)"));
_("Images (*.png *.jpg)"));
if (!saveAsName.isEmpty())
{
@ -654,9 +654,9 @@ void CelestiaAppWindow::slotCaptureVideo()
float videoFrameRates[5] = { 15.0f, 24.0f, 25.0f, 29.97f, 30.0f };
QString saveAsName = QFileDialog::getSaveFileName(this,
tr("Capture Video"),
_("Capture Video"),
dir,
tr("Video (*.avi)"));
_("Video (*.avi)"));
if (!saveAsName.isEmpty())
{
QDialog videoInfoDialog(this);
@ -665,7 +665,7 @@ void CelestiaAppWindow::slotCaptureVideo()
QGridLayout* layout = new QGridLayout(&videoInfoDialog);
QComboBox* resolutionCombo = new QComboBox(&videoInfoDialog);
layout->addWidget(new QLabel(tr("Resolution:"), &videoInfoDialog), 0, 0);
layout->addWidget(new QLabel(_("Resolution:"), &videoInfoDialog), 0, 0);
layout->addWidget(resolutionCombo, 0, 1);
for (unsigned int i = 0; i < sizeof(videoSizes) / sizeof(videoSizes[0]); i++)
{
@ -673,7 +673,7 @@ void CelestiaAppWindow::slotCaptureVideo()
}
QComboBox* frameRateCombo = new QComboBox(&videoInfoDialog);
layout->addWidget(new QLabel(tr("Frame rate:"), &videoInfoDialog), 1, 0);
layout->addWidget(new QLabel(_("Frame rate:"), &videoInfoDialog), 1, 0);
layout->addWidget(frameRateCombo, 1, 1);
for (unsigned int i = 0; i < sizeof(videoFrameRates) / sizeof(videoFrameRates[0]); i++)
{
@ -715,7 +715,7 @@ void CelestiaAppWindow::slotCopyImage()
//glWidget->repaint();
QImage grabbedImage = glWidget->grabFrameBuffer();
QApplication::clipboard()->setImage(grabbedImage);
m_appCore->flash(tr("Captured screen shot to clipboard").toUtf8().data());
m_appCore->flash(QString(_("Captured screen shot to clipboard")).toUtf8().data());
}
@ -726,7 +726,7 @@ void CelestiaAppWindow::slotCopyURL()
Url url(appState, 3);
QApplication::clipboard()->setText(url.getAsString().c_str());
m_appCore->flash(tr("Copied URL").toUtf8().data());
m_appCore->flash(QString(_("Copied URL")).toUtf8().data());
}
@ -736,7 +736,7 @@ void CelestiaAppWindow::slotPasteURL()
if (!urlText.isEmpty())
{
m_appCore->goToUrl(urlText.toUtf8().data());
m_appCore->flash(tr("Pasting URL").toUtf8().data());
m_appCore->flash(QString(_("Pasting URL")).toUtf8().data());
}
}
@ -853,9 +853,9 @@ void CelestiaAppWindow::slotOpenScriptDialog()
}
QString scriptFileName = QFileDialog::getOpenFileName(this,
tr("Open Script"),
_("Open Script"),
dir,
tr("Celestia Scripts (*.celx *.cel)"));
_("Celestia Scripts (*.celx *.cel)"));
if (!scriptFileName.isEmpty())
{
@ -886,7 +886,7 @@ void CelestiaAppWindow::slotShowTimeDialog()
SetTimeDialog* timeDialog = new SetTimeDialog(m_appCore->getSimulation()->getTime(),
this, m_appCore);
timeDialog->exec();
timeDialog->show();
}
@ -907,17 +907,17 @@ void CelestiaAppWindow::slotAddBookmark()
if (sel.body() != NULL)
{
defaultTitle = QString::fromUtf8(sel.body()->getName().c_str());
defaultTitle = QString::fromUtf8(sel.body()->getName(true).c_str());
}
else if (sel.star() != NULL)
{
Universe* universe = m_appCore->getSimulation()->getUniverse();
defaultTitle = QString::fromUtf8(universe->getStarCatalog()->getStarName(*sel.star()).c_str());
defaultTitle = QString::fromUtf8(ReplaceGreekLetterAbbr(universe->getStarCatalog()->getStarName(*sel.star(), true)).c_str());
}
else if (sel.deepsky() != NULL)
{
Universe* universe = m_appCore->getSimulation()->getUniverse();
defaultTitle = QString::fromUtf8(universe->getDSOCatalog()->getDSOName(sel.deepsky()).c_str());
defaultTitle = QString::fromUtf8(ReplaceGreekLetterAbbr(universe->getDSOCatalog()->getDSOName(sel.deepsky(), true)).c_str());
}
else if (sel.location() != NULL)
{
@ -925,7 +925,7 @@ void CelestiaAppWindow::slotAddBookmark()
}
if (defaultTitle.isEmpty())
defaultTitle = tr("New bookmark");
defaultTitle = _("New bookmark");
CelestiaState appState;
appState.captureState(m_appCore);
@ -966,25 +966,25 @@ void CelestiaAppWindow::slotBookmarkTriggered(const QString& url)
}
static const char* aboutText =
"<html>"
"<p><b>Celestia 1.5.0 (Qt4 experimental version)</b></p>"
"<p>Copyright (C) 2001-2008 by the Celestia Development Team. Celestia "
"is free software. You can redistribute it and/or modify it under the "
"terms of the GNU General Public License version 2.</p>"
"<b>Celestia on the web</b>"
"<br>"
"Main site: <a href=\"http://www.shatters.net/celestia/\">"
"http://www.shatters.net/celestia/</a><br>"
"Forum: <a href=\"http://www.shatters.net/forum/\">"
"http://www.shatters.net/forum/</a><br>"
"SourceForge project: <a href=\"http://www.sourceforge.net/projects/celestia\">"
"http://www.sourceforge.net/projects/celestia</a><br>"
"</html>";
void CelestiaAppWindow::slotShowAbout()
{
QMessageBox::about(this, "Celestia", aboutText);
static const char* aboutText =
gettext_noop("<html>"
"<p><b>Celestia 1.6.0 (Qt4 experimental version)</b></p>"
"<p>Copyright (C) 2001-2009 by the Celestia Development Team. Celestia "
"is free software. You can redistribute it and/or modify it under the "
"terms of the GNU General Public License version 2.</p>"
"<b>Celestia on the web</b>"
"<br>"
"Main site: <a href=\"http://www.shatters.net/celestia/\">"
"http://www.shatters.net/celestia/</a><br>"
"Forum: <a href=\"http://www.shatters.net/forum/\">"
"http://www.shatters.net/forum/</a><br>"
"SourceForge project: <a href=\"http://www.sourceforge.net/projects/celestia\">"
"http://www.sourceforge.net/projects/celestia</a><br>"
"</html>");
QMessageBox::about(this, "Celestia", _(aboutText));
}
@ -996,7 +996,7 @@ void CelestiaAppWindow::slotShowGLInfo()
QTextStream out(&infoText, QIODevice::WriteOnly);
// Get the version string
out << "<b>OpenGL version: </b>";
out << _("<b>OpenGL version: </b>");
const char* version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
if (version != NULL)
out << version;
@ -1004,7 +1004,7 @@ void CelestiaAppWindow::slotShowGLInfo()
out << "???";
out << "<br>\n";
out << "<b>Renderer: </b>";
out << _("<b>Renderer: </b>");
const char* glrenderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
if (glrenderer != NULL)
out << glrenderer;
@ -1020,18 +1020,18 @@ void CelestiaAppWindow::slotShowGLInfo()
#endif
if (glslversion != NULL)
{
out << "<b>GLSL Version: </b>" << glslversion << "<br>\n";
out << _("<b>GLSL Version: </b>") << glslversion << "<br>\n";
}
// texture size
GLint maxTextureSize = 0;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
out << "<b>Maximum texture size: </b>" << maxTextureSize << "<br>\n";
out << _("<b>Maximum texture size: </b>") << maxTextureSize << "<br>\n";
out << "<br>\n";
// Show all supported extensions
out << "<b>Extensions:</b><br>\n";
out << _("<b>Extensions:</b><br>\n");
const char *extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
if (extensions != NULL)
{
@ -1066,38 +1066,39 @@ void CelestiaAppWindow::createActions()
void CelestiaAppWindow::createMenus()
{
/****** File menu ******/
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu = menuBar()->addMenu(_("&File"));
QAction* grabImageAction = new QAction(QIcon(":data/grab-image.png"),
tr("&Grab image"), this);
grabImageAction->setShortcut(tr("F10"));
_("&Grab image"), this);
grabImageAction->setShortcut(QString(_("F10")));
connect(grabImageAction, SIGNAL(triggered()), this, SLOT(slotGrabImage()));
fileMenu->addAction(grabImageAction);
QAction* captureVideoAction = new QAction(QIcon(":data/capture-video.png"),
tr("Capture &video"), this);
//captureVideoAction->setShortcut(tr("F11"));
_("Capture &video"), this);
//captureVideoAction->setShortcut(_("F11"));
connect(captureVideoAction, SIGNAL(triggered()), this, SLOT(slotCaptureVideo()));
fileMenu->addAction(captureVideoAction);
QAction* copyImageAction = new QAction(tr("&Copy image"), this);
copyImageAction->setShortcut(tr("Ctrl+Shift+C", "File|Copy Image"));
QAction* copyImageAction = new QAction(_("&Copy image"), this);
//copyImageAction->setShortcut(QString(_("Ctrl+Shift+C", "File|Copy Image")));
copyImageAction->setShortcut(QString(_("Ctrl+Shift+C")));
connect(copyImageAction, SIGNAL(triggered()), this, SLOT(slotCopyImage()));
fileMenu->addAction(copyImageAction);
QAction* copyURLAction = new QAction(tr("Copy &URL"), this);
QAction* copyURLAction = new QAction(_("Copy &URL"), this);
copyURLAction->setShortcut(QKeySequence::Copy);
connect(copyURLAction, SIGNAL(triggered()), this, SLOT(slotCopyURL()));
fileMenu->addAction(copyURLAction);
QAction* pasteURLAction = new QAction(tr("&Paste URL"), this);
QAction* pasteURLAction = new QAction(_("&Paste URL"), this);
//pasteURLAction->setShortcut(QKeySequence::Paste); // conflicts with cycle render path command
connect(pasteURLAction, SIGNAL(triggered()), this, SLOT(slotPasteURL()));
fileMenu->addAction(pasteURLAction);
fileMenu->addSeparator();
QAction* openScriptAction = new QAction(tr("&Open Script..."), this);
QAction* openScriptAction = new QAction(_("&Open Script..."), this);
connect(openScriptAction, SIGNAL(triggered()), this, SLOT(slotOpenScriptDialog()));
fileMenu->addAction(openScriptAction);
@ -1108,37 +1109,37 @@ void CelestiaAppWindow::createMenus()
fileMenu->addSeparator();
QAction* prefAct = new QAction(QIcon(":data/preferences.png"),
tr("&Preferences..."), this);
_("&Preferences..."), this);
connect(prefAct, SIGNAL(triggered()), this, SLOT(slotPreferences()));
fileMenu->addAction(prefAct);
QAction* quitAct = new QAction(QIcon(":data/exit.png"), tr("E&xit"), this);
quitAct->setShortcut(tr("Ctrl+Q"));
QAction* quitAct = new QAction(QIcon(":data/exit.png"), _("E&xit"), this);
quitAct->setShortcut(QString(_("Ctrl+Q")));
connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));
fileMenu->addAction(quitAct);
/****** Navigation menu ******/
navMenu = menuBar()->addMenu(tr("&Navigation"));
navMenu = menuBar()->addMenu(_("&Navigation"));
QAction* sunAct = new QAction(tr("Select Sun"), this);
QAction* sunAct = new QAction(_("Select Sun"), this);
connect(sunAct, SIGNAL(triggered()), this, SLOT(selectSun()));
navMenu->addAction(sunAct);
QAction* centerAct = new QAction(tr("Center Selection"), this);
QAction* centerAct = new QAction(_("Center Selection"), this);
connect(centerAct, SIGNAL(triggered()), this, SLOT(centerSelection()));
navMenu->addAction(centerAct);
QAction* gotoAct = new QAction(tr("Goto Selection"), this);
QAction* gotoAct = new QAction(_("Goto Selection"), this);
connect(gotoAct, SIGNAL(triggered()), this, SLOT(gotoSelection()));
navMenu->addAction(gotoAct);
/****** Time menu ******/
timeMenu = menuBar()->addMenu(tr("&Time"));
timeMenu = menuBar()->addMenu(_("&Time"));
QAction* setTimeAct = new QAction(tr("Set &time"), this);
QAction* setTimeAct = new QAction(_("Set &time"), this);
connect(setTimeAct, SIGNAL(triggered()), this, SLOT(slotShowTimeDialog()));
timeMenu->addAction(setTimeAct);
@ -1146,19 +1147,19 @@ void CelestiaAppWindow::createMenus()
/****** Display menu ******/
displayMenu = menuBar()->addMenu(tr("&Display"));
displayMenu = menuBar()->addMenu(_("&Display"));
displayMenu->addAction(actions->atmospheresAction);
displayMenu->addAction(actions->cloudsAction);
displayMenu->addAction(actions->cometTailsAction);
displayMenu->addAction(actions->nightSideLightsAction);
QMenu* deepSkyMenu = displayMenu->addMenu(tr("Dee&p Sky Objects"));
QMenu* deepSkyMenu = displayMenu->addMenu(_("Dee&p Sky Objects"));
deepSkyMenu->addAction(actions->galaxiesAction);
deepSkyMenu->addAction(actions->globularsAction);
deepSkyMenu->addAction(actions->openClustersAction);
deepSkyMenu->addAction(actions->nebulaeAction);
QMenu* shadowMenu = displayMenu->addMenu(tr("&Shadows"));
QMenu* shadowMenu = displayMenu->addMenu(_("&Shadows"));
shadowMenu->addAction(actions->ringShadowsAction);
shadowMenu->addAction(actions->eclipseShadowsAction);
shadowMenu->addAction(actions->cloudShadowsAction);
@ -1169,61 +1170,61 @@ void CelestiaAppWindow::createMenus()
displayMenu->addAction(actions->decreaseLimitingMagAction);
displayMenu->addAction(actions->autoMagAction);
QMenu* starStyleMenu = displayMenu->addMenu(tr("Star St&yle"));
QMenu* starStyleMenu = displayMenu->addMenu(_("Star St&yle"));
starStyleMenu->addAction(actions->pointStarAction);
starStyleMenu->addAction(actions->fuzzyPointStarAction);
starStyleMenu->addAction(actions->scaledDiscStarAction);
displayMenu->addSeparator();
QMenu* textureResolutionMenu = displayMenu->addMenu(tr("Texture &Resolution"));
QMenu* textureResolutionMenu = displayMenu->addMenu(_("Texture &Resolution"));
textureResolutionMenu->addAction(actions->lowResAction);
textureResolutionMenu->addAction(actions->mediumResAction);
textureResolutionMenu->addAction(actions->highResAction);
/****** Bookmark menu ******/
bookmarkMenu = menuBar()->addMenu(tr("&Bookmarks"));
bookmarkMenu = menuBar()->addMenu(_("&Bookmarks"));
/****** View menu ******/
viewMenu = menuBar()->addMenu(tr("&View"));
viewMenu = menuBar()->addMenu(_("&View"));
/****** MultiView menu ******/
QMenu* multiviewMenu = menuBar()->addMenu(tr("&MultiView"));
QMenu* multiviewMenu = menuBar()->addMenu(_("&MultiView"));
QAction* splitViewVertAction = new QAction(QIcon(":data/split-vert.png"),
tr("Split view vertically"), this);
splitViewVertAction->setShortcut(tr("Ctrl+R"));
_("Split view vertically"), this);
splitViewVertAction->setShortcut(QString(_("Ctrl+R")));
connect(splitViewVertAction, SIGNAL(triggered()), this, SLOT(slotSplitViewVertically()));
multiviewMenu->addAction(splitViewVertAction);
QAction* splitViewHorizAction = new QAction(QIcon(":data/split-horiz.png"),
tr("Split view horizontally"), this);
splitViewHorizAction->setShortcut(tr("Ctrl+U"));
_("Split view horizontally"), this);
splitViewHorizAction->setShortcut(QString(_("Ctrl+U")));
connect(splitViewHorizAction, SIGNAL(triggered()), this, SLOT(slotSplitViewHorizontally()));
multiviewMenu->addAction(splitViewHorizAction);
QAction* cycleViewAction = new QAction(QIcon(":data/split-cycle.png"),
tr("Cycle views"), this);
cycleViewAction->setShortcut(tr("Tab"));
_("Cycle views"), this);
cycleViewAction->setShortcut(QString(_("Tab")));
connect(cycleViewAction, SIGNAL(triggered()), this, SLOT(slotCycleView()));
multiviewMenu->addAction(cycleViewAction);
QAction* singleViewAction = new QAction(QIcon(":data/split-single.png"),
tr("Single view"), this);
singleViewAction->setShortcut(tr("Ctrl+D"));
_("Single view"), this);
singleViewAction->setShortcut(QString(_("Ctrl+D")));
connect(singleViewAction, SIGNAL(triggered()), this, SLOT(slotSingleView()));
multiviewMenu->addAction(singleViewAction);
QAction* deleteViewAction = new QAction(QIcon(":data/split-delete.png"),
tr("Delete view"), this);
deleteViewAction->setShortcut(tr("Delete"));
_("Delete view"), this);
deleteViewAction->setShortcut(QString(_("Delete")));
connect(deleteViewAction, SIGNAL(triggered()), this, SLOT(slotDeleteView()));
multiviewMenu->addAction(deleteViewAction);
multiviewMenu->addSeparator();
QAction* framesVisibleAction = new QAction(tr("Frames visible"), this);
QAction* framesVisibleAction = new QAction(_("Frames visible"), this);
framesVisibleAction->setCheckable(true);
connect(framesVisibleAction, SIGNAL(triggered()), this, SLOT(slotToggleFramesVisible()));
multiviewMenu->addAction(framesVisibleAction);
@ -1243,7 +1244,7 @@ void CelestiaAppWindow::createMenus()
framesVisibleAction->setChecked(check);
m_appCore->setFramesVisible(check);
QAction* activeFrameVisibleAction = new QAction(tr("Active frame visible"), this);
QAction* activeFrameVisibleAction = new QAction(_("Active frame visible"), this);
activeFrameVisibleAction->setCheckable(true);
connect(activeFrameVisibleAction, SIGNAL(triggered()), this, SLOT(slotToggleActiveFrameVisible()));
multiviewMenu->addAction(activeFrameVisibleAction);
@ -1259,7 +1260,7 @@ void CelestiaAppWindow::createMenus()
activeFrameVisibleAction->setChecked(check);
m_appCore->setActiveFrameVisible(check);
QAction* syncTimeAction = new QAction(tr("Synchronize time"), this);
QAction* syncTimeAction = new QAction(_("Synchronize time"), this);
syncTimeAction->setCheckable(true);
connect(syncTimeAction, SIGNAL(triggered()), this, SLOT(slotToggleSyncTime()));
multiviewMenu->addAction(syncTimeAction);
@ -1303,14 +1304,14 @@ void CelestiaAppWindow::createMenus()
}
/****** Help Menu ******/
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu = menuBar()->addMenu(_("&Help"));
QAction* aboutAct = new QAction(tr("About Celestia"), this);
QAction* aboutAct = new QAction(_("About Celestia"), this);
connect(aboutAct, SIGNAL(triggered()), this, SLOT(slotShowAbout()));
helpMenu->addAction(aboutAct);
helpMenu->addSeparator();
QAction* glInfoAct = new QAction(tr("OpenGL Info"), this);
QAction* glInfoAct = new QAction(_("OpenGL Info"), this);
connect(glInfoAct, SIGNAL(triggered()), this, SLOT(slotShowGLInfo()));
helpMenu->addAction(glInfoAct);
@ -1326,11 +1327,11 @@ void CelestiaAppWindow::populateBookmarkMenu()
{
bookmarkMenu->clear();
QAction* addBookmarkAction = new QAction(tr("Add Bookmark..."), bookmarkMenu);
QAction* addBookmarkAction = new QAction(_("Add Bookmark..."), bookmarkMenu);
bookmarkMenu->addAction(addBookmarkAction);
connect(addBookmarkAction, SIGNAL(triggered()), this, SLOT(slotAddBookmark()));
QAction* organizeBookmarksAction = new QAction(tr("Organize Bookmarks..."), bookmarkMenu);
QAction* organizeBookmarksAction = new QAction(_("Organize Bookmarks..."), bookmarkMenu);
bookmarkMenu->addAction(organizeBookmarksAction);
connect(organizeBookmarksAction, SIGNAL(triggered()), this, SLOT(slotOrganizeBookmarks()));
@ -1369,7 +1370,7 @@ QMenu* CelestiaAppWindow::buildScriptsMenu()
if (scripts->empty())
return NULL;
QMenu* menu = new QMenu(tr("Scripts"));
QMenu* menu = new QMenu(_("Scripts"));
for (vector<ScriptMenuItem>::const_iterator iter = scripts->begin();
iter != scripts->end(); iter++)

View File

@ -405,9 +405,9 @@ BookmarkTreeModel::headerData(int section, Qt::Orientation /* orientation */, in
return QVariant();
if (section == 0)
return tr("Title");
return _("Title");
else
return tr("Description");
return _("Description");
}
@ -592,14 +592,14 @@ BookmarkManager::initializeBookmarks()
m_root->setTitle("root");
BookmarkItem* menuBookmarks = new BookmarkItem(BookmarkItem::Folder, m_root);
menuBookmarks->setTitle(tr("Bookmarks Menu"));
menuBookmarks->setDescription(tr("Add bookmarks to this folder to see them in the bookmarks menu."));
menuBookmarks->setTitle(_("Bookmarks Menu"));
menuBookmarks->setDescription(_("Add bookmarks to this folder to see them in the bookmarks menu."));
menuBookmarks->setFolded(false);
m_root->append(menuBookmarks);
BookmarkItem* toolbarBookmarks = new BookmarkItem(BookmarkItem::Folder, m_root);
toolbarBookmarks->setTitle(tr("Bookmarks Toolbar"));
toolbarBookmarks->setDescription(tr("Add bookmarks to this folder to see them in the bookmarks toolbar."));
toolbarBookmarks->setTitle(_("Bookmarks Toolbar"));
toolbarBookmarks->setDescription(_("Add bookmarks to this folder to see them in the bookmarks toolbar."));
menuBookmarks->setFolded(false);
m_root->append(toolbarBookmarks);
@ -613,7 +613,7 @@ BookmarkManager::loadBookmarks(QIODevice* device)
XbelReader reader(device);
m_root = reader.read();
if (m_root == NULL)
QMessageBox::warning(NULL, tr("Error reading bookmarks file"), reader.errorString());
QMessageBox::warning(NULL, _("Error reading bookmarks file"), reader.errorString());
m_model->m_root = m_root;
@ -727,7 +727,7 @@ BookmarkToolBar::BookmarkToolBar(BookmarkManager* manager, QWidget* parent) :
QToolBar(parent),
m_manager(manager)
{
setWindowTitle(tr("Bookmarks"));
setWindowTitle(_("Bookmarks"));
setObjectName("bookmark-toolbar");
setFloatable(true);
setMovable(true);
@ -837,9 +837,9 @@ AddBookmarkDialog::AddBookmarkDialog(BookmarkManager* manager,
view->show();
createInCombo->setView(view);
timeSourceCombo->addItem(tr("Current simulation time"), (int) Url::UseUrlTime);
timeSourceCombo->addItem(tr("Simulation time at activation"), (int) Url::UseSimulationTime);
timeSourceCombo->addItem(tr("System time at activation"), (int) Url::UseSystemTime);
timeSourceCombo->addItem(_("Current simulation time"), (int) Url::UseUrlTime);
timeSourceCombo->addItem(_("Simulation time at activation"), (int) Url::UseSimulationTime);
timeSourceCombo->addItem(_("System time at activation"), (int) Url::UseSystemTime);
timeSourceCombo->setCurrentIndex(m_lastTimeSourceIndex);
// Initialize to first index
@ -884,7 +884,7 @@ NewBookmarkFolderDialog::NewBookmarkFolderDialog(BookmarkManager* manager) :
m_manager(manager)
{
setupUi(this);
nameEdit->setText(tr("New Folder"));
nameEdit->setText(_("New Folder"));
BookmarkTreeModel* model = manager->model();

View File

@ -63,48 +63,48 @@ CelestiaActions::CelestiaActions(QObject* parent,
appCore(_appCore)
{
// Create the render flags actions
equatorialGridAction = new QAction(QString("Eq"), this);
equatorialGridAction->setToolTip(tr("Equatorial coordinate grid"));
equatorialGridAction = new QAction(_("Eq"), this);
equatorialGridAction->setToolTip(_("Equatorial coordinate grid"));
equatorialGridAction->setCheckable(true);
equatorialGridAction->setData(Renderer::ShowCelestialSphere);
galacticGridAction = new QAction(QString("Ga"), this);
galacticGridAction->setToolTip(tr("Galactic coordinate grid"));
galacticGridAction = new QAction(_("Ga"), this);
galacticGridAction->setToolTip(_("Galactic coordinate grid"));
galacticGridAction->setCheckable(true);
galacticGridAction->setData(Renderer::ShowGalacticGrid);
eclipticGridAction = new QAction(QString("Ec"), this);
eclipticGridAction->setToolTip(tr("Ecliptic coordinate grid"));
eclipticGridAction = new QAction(_("Ec"), this);
eclipticGridAction->setToolTip(_("Ecliptic coordinate grid"));
eclipticGridAction->setCheckable(true);
eclipticGridAction->setData(Renderer::ShowEclipticGrid);
horizonGridAction = new QAction(QString("Hz"), this);
horizonGridAction->setToolTip(tr("Horizontal coordinate grid"));
horizonGridAction = new QAction(_("Hz"), this);
horizonGridAction->setToolTip(_("Horizontal coordinate grid"));
horizonGridAction->setCheckable(true);
horizonGridAction->setData(Renderer::ShowHorizonGrid);
eclipticAction = new QAction(QString("Ecl"), this);
eclipticAction->setToolTip(tr("Ecliptic line"));
eclipticAction = new QAction(_("Ecl"), this);
eclipticAction->setToolTip(_("Ecliptic line"));
eclipticAction->setCheckable(true);
eclipticAction->setData(Renderer::ShowEcliptic);
markersAction = new QAction(QString("M"), this);
markersAction->setToolTip(tr("Markers"));
markersAction = new QAction(_("M"), this);
markersAction->setToolTip(_("Markers"));
markersAction->setCheckable(true);
markersAction->setData(Renderer::ShowMarkers);
constellationsAction = new QAction(QString("C"), this);
constellationsAction->setToolTip(tr("Constellations"));
constellationsAction = new QAction(_("C"), this);
constellationsAction->setToolTip(_("Constellations"));
constellationsAction->setCheckable(true);
constellationsAction->setData(Renderer::ShowDiagrams);
boundariesAction = new QAction(QString("B"), this);
boundariesAction->setToolTip(tr("Constellation boundaries"));
boundariesAction = new QAction(_("B"), this);
boundariesAction->setToolTip(_("Constellation boundaries"));
boundariesAction->setCheckable(true);
boundariesAction->setData(Renderer::ShowBoundaries);
orbitsAction = new QAction(QString("O"), this);
orbitsAction->setToolTip(tr("Orbits"));
orbitsAction = new QAction(_("O"), this);
orbitsAction->setToolTip(_("Orbits"));
orbitsAction->setCheckable(true);
orbitsAction->setData(Renderer::ShowOrbits);
@ -120,14 +120,14 @@ CelestiaActions::CelestiaActions(QObject* parent,
// Orbit actions
QMenu* orbitsMenu = new QMenu();
starOrbitsAction = createCheckableAction(tr("Stars"), orbitsMenu, Body::Stellar);
planetOrbitsAction = createCheckableAction(tr("Planets"), orbitsMenu, Body::Planet);
dwarfPlanetOrbitsAction = createCheckableAction(tr("Dwarf Planets"), orbitsMenu, Body::DwarfPlanet);
moonOrbitsAction = createCheckableAction(tr("Moons"), orbitsMenu, Body::Moon);
minorMoonOrbitsAction = createCheckableAction(tr("Minor Moons"), orbitsMenu, Body::MinorMoon);
asteroidOrbitsAction = createCheckableAction(tr("Asteroids"), orbitsMenu, Body::Asteroid);
cometOrbitsAction = createCheckableAction(tr("Comets"), orbitsMenu, Body::Comet);
spacecraftOrbitsAction = createCheckableAction(tr("Spacecraft"), orbitsMenu, Body::Spacecraft);
starOrbitsAction = createCheckableAction(_("Stars"), orbitsMenu, Body::Stellar);
planetOrbitsAction = createCheckableAction(_("Planets"), orbitsMenu, Body::Planet);
dwarfPlanetOrbitsAction = createCheckableAction(_("Dwarf Planets"), orbitsMenu, Body::DwarfPlanet);
moonOrbitsAction = createCheckableAction(_("Moons"), orbitsMenu, Body::Moon);
minorMoonOrbitsAction = createCheckableAction(_("Minor Moons"), orbitsMenu, Body::MinorMoon);
asteroidOrbitsAction = createCheckableAction(_("Asteroids"), orbitsMenu, Body::Asteroid);
cometOrbitsAction = createCheckableAction(_("Comets"), orbitsMenu, Body::Comet);
spacecraftOrbitsAction = createCheckableAction(_("Spacecraft"), orbitsMenu, Body::Spacecraft);
connect(starOrbitsAction, SIGNAL(triggered()), this, SLOT(slotToggleOrbit()));
connect(planetOrbitsAction, SIGNAL(triggered()), this, SLOT(slotToggleOrbit()));
@ -143,24 +143,24 @@ CelestiaActions::CelestiaActions(QObject* parent,
orbitsAction->setMenu(orbitsMenu);
// Label actions
labelsAction = new QAction(QString("L"), this);
labelsAction->setToolTip(tr("Labels"));
labelsAction = new QAction(_("L"), this);
labelsAction->setToolTip(_("Labels"));
QMenu* labelsMenu = new QMenu();
labelStarsAction = createCheckableAction(tr("Stars"), labelsMenu, Renderer::StarLabels);
labelPlanetsAction = createCheckableAction(tr("Planets"), labelsMenu, Renderer::PlanetLabels);
labelDwarfPlanetsAction = createCheckableAction(tr("Dwarf Planets"), labelsMenu, Renderer::DwarfPlanetLabels);
labelMoonsAction = createCheckableAction(tr("Moons"), labelsMenu, Renderer::MoonLabels);
labelMinorMoonsAction = createCheckableAction(tr("Minor Moons"), labelsMenu, Renderer::MinorMoonLabels);
labelAsteroidsAction = createCheckableAction(tr("Asteroids"), labelsMenu, Renderer::AsteroidLabels);
labelCometsAction = createCheckableAction(tr("Comets"), labelsMenu, Renderer::CometLabels);
labelSpacecraftAction = createCheckableAction(tr("Spacecraft"), labelsMenu, Renderer::SpacecraftLabels);
labelGalaxiesAction = createCheckableAction(tr("Galaxies"), labelsMenu, Renderer::GalaxyLabels);
labelGlobularsAction = createCheckableAction(tr("Globulars"), labelsMenu, Renderer::GlobularLabels);
labelOpenClustersAction = createCheckableAction(tr("Open clusters"), labelsMenu, Renderer::OpenClusterLabels);
labelNebulaeAction = createCheckableAction(tr("Nebulae"), labelsMenu, Renderer::NebulaLabels);
labelLocationsAction = createCheckableAction(tr("Locations"), labelsMenu, Renderer::LocationLabels);
labelConstellationsAction = createCheckableAction(tr("Constellations"), labelsMenu, Renderer::ConstellationLabels);
labelStarsAction = createCheckableAction(_("Stars"), labelsMenu, Renderer::StarLabels);
labelPlanetsAction = createCheckableAction(_("Planets"), labelsMenu, Renderer::PlanetLabels);
labelDwarfPlanetsAction = createCheckableAction(_("Dwarf Planets"), labelsMenu, Renderer::DwarfPlanetLabels);
labelMoonsAction = createCheckableAction(_("Moons"), labelsMenu, Renderer::MoonLabels);
labelMinorMoonsAction = createCheckableAction(_("Minor Moons"), labelsMenu, Renderer::MinorMoonLabels);
labelAsteroidsAction = createCheckableAction(_("Asteroids"), labelsMenu, Renderer::AsteroidLabels);
labelCometsAction = createCheckableAction(_("Comets"), labelsMenu, Renderer::CometLabels);
labelSpacecraftAction = createCheckableAction(_("Spacecraft"), labelsMenu, Renderer::SpacecraftLabels);
labelGalaxiesAction = createCheckableAction(_("Galaxies"), labelsMenu, Renderer::GalaxyLabels);
labelGlobularsAction = createCheckableAction(_("Globulars"), labelsMenu, Renderer::GlobularLabels);
labelOpenClustersAction = createCheckableAction(_("Open clusters"), labelsMenu, Renderer::OpenClusterLabels);
labelNebulaeAction = createCheckableAction(_("Nebulae"), labelsMenu, Renderer::NebulaLabels);
labelLocationsAction = createCheckableAction(_("Locations"), labelsMenu, Renderer::LocationLabels);
labelConstellationsAction = createCheckableAction(_("Constellations"), labelsMenu, Renderer::ConstellationLabels);
connect(labelGalaxiesAction, SIGNAL(triggered()), this, SLOT(slotToggleLabel()));
connect(labelGlobularsAction, SIGNAL(triggered()), this, SLOT(slotToggleLabel()));
@ -179,66 +179,66 @@ CelestiaActions::CelestiaActions(QObject* parent,
labelsAction->setMenu(labelsMenu);
galaxiesAction = createCheckableAction(tr("Galaxies"), Renderer::ShowGalaxies);
galaxiesAction = createCheckableAction(_("Galaxies"), Renderer::ShowGalaxies);
//galaxiesAction->setShortcut(QString("U"));
globularsAction = createCheckableAction(tr("Globulars"), Renderer::ShowGlobulars);
openClustersAction = createCheckableAction(tr("Open Clusters"), Renderer::ShowOpenClusters);
nebulaeAction = createCheckableAction(tr("Nebulae"), Renderer::ShowNebulae);
globularsAction = createCheckableAction(_("Globulars"), Renderer::ShowGlobulars);
openClustersAction = createCheckableAction(_("Open Clusters"), Renderer::ShowOpenClusters);
nebulaeAction = createCheckableAction(_("Nebulae"), Renderer::ShowNebulae);
nebulaeAction->setShortcut(QString("^"));
connect(galaxiesAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(globularsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(openClustersAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(nebulaeAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
cloudsAction = createCheckableAction(tr("Clouds"), Renderer::ShowCloudMaps);
cloudsAction = createCheckableAction(_("Clouds"), Renderer::ShowCloudMaps);
//cloudsAction->setShortcut(QString("I"));
nightSideLightsAction = createCheckableAction(tr("Night Side Lights"), Renderer::ShowNightMaps);
nightSideLightsAction = createCheckableAction(_("Night Side Lights"), Renderer::ShowNightMaps);
nightSideLightsAction->setShortcut(QString("Ctrl+L"));
cometTailsAction = createCheckableAction(tr("Comet Tails"), Renderer::ShowCometTails);
atmospheresAction = createCheckableAction(tr("Atmospheres"), Renderer::ShowAtmospheres);
cometTailsAction = createCheckableAction(_("Comet Tails"), Renderer::ShowCometTails);
atmospheresAction = createCheckableAction(_("Atmospheres"), Renderer::ShowAtmospheres);
atmospheresAction->setShortcut(QString("Ctrl+A"));
connect(cloudsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(nightSideLightsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(cometTailsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(atmospheresAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
ringShadowsAction = createCheckableAction(tr("Ring Shadows"), Renderer::ShowRingShadows);
eclipseShadowsAction = createCheckableAction(tr("Eclipse Shadows"), Renderer::ShowEclipseShadows);
ringShadowsAction = createCheckableAction(_("Ring Shadows"), Renderer::ShowRingShadows);
eclipseShadowsAction = createCheckableAction(_("Eclipse Shadows"), Renderer::ShowEclipseShadows);
eclipseShadowsAction->setShortcut(QKeySequence("Ctrl+E"));
cloudShadowsAction = createCheckableAction(tr("Cloud Shadows"), Renderer::ShowCloudShadows);
cloudShadowsAction = createCheckableAction(_("Cloud Shadows"), Renderer::ShowCloudShadows);
connect(ringShadowsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(eclipseShadowsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
connect(cloudShadowsAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
lowResAction = createCheckableAction(tr("Low"), lores);
mediumResAction = createCheckableAction(tr("Medium"), medres);
highResAction = createCheckableAction(tr("High"), hires);
lowResAction = createCheckableAction(_("Low"), lores);
mediumResAction = createCheckableAction(_("Medium"), medres);
highResAction = createCheckableAction(_("High"), hires);
connect(lowResAction, SIGNAL(triggered()), this, SLOT(slotSetTextureResolution()));
connect(mediumResAction, SIGNAL(triggered()), this, SLOT(slotSetTextureResolution()));
connect(highResAction, SIGNAL(triggered()), this, SLOT(slotSetTextureResolution()));
autoMagAction = createCheckableAction(tr("Auto Magnitude"), Renderer::ShowAutoMag);
autoMagAction = createCheckableAction(_("Auto Magnitude"), Renderer::ShowAutoMag);
autoMagAction->setShortcut(QKeySequence("Ctrl+Y"));
autoMagAction->setToolTip(tr("Faintest visible magnitude based on field of view"));
autoMagAction->setToolTip(_("Faintest visible magnitude based on field of view"));
connect(autoMagAction, SIGNAL(triggered()), this, SLOT(slotToggleRenderFlag()));
increaseLimitingMagAction = new QAction(tr("More Stars Visible"), this);
increaseLimitingMagAction = new QAction(_("More Stars Visible"), this);
increaseLimitingMagAction->setData(0.1);
increaseLimitingMagAction->setShortcut(QString("]"));
decreaseLimitingMagAction = new QAction(tr("Fewer Stars Visible"), this);
decreaseLimitingMagAction = new QAction(_("Fewer Stars Visible"), this);
decreaseLimitingMagAction->setData(-0.1);
decreaseLimitingMagAction->setShortcut(QString("["));
connect(increaseLimitingMagAction, SIGNAL(triggered()), this, SLOT(slotAdjustLimitingMagnitude()));
connect(decreaseLimitingMagAction, SIGNAL(triggered()), this, SLOT(slotAdjustLimitingMagnitude()));
pointStarAction = createCheckableAction(tr("Points"), Renderer::PointStars);
fuzzyPointStarAction = createCheckableAction(tr("Fuzzy Points"), Renderer::FuzzyPointStars);
scaledDiscStarAction = createCheckableAction(tr("Scaled Discs"), Renderer::ScaledDiscStars);
pointStarAction = createCheckableAction(_("Points"), Renderer::PointStars);
fuzzyPointStarAction = createCheckableAction(_("Fuzzy Points"), Renderer::FuzzyPointStars);
scaledDiscStarAction = createCheckableAction(_("Scaled Discs"), Renderer::ScaledDiscStars);
connect(pointStarAction, SIGNAL(triggered()), this, SLOT(slotSetStarStyle()));
connect(fuzzyPointStarAction, SIGNAL(triggered()), this, SLOT(slotSetStarStyle()));
connect(scaledDiscStarAction, SIGNAL(triggered()), this, SLOT(slotSetStarStyle()));
lightTimeDelayAction = new QAction(tr("Light Time Delay"), this);
lightTimeDelayAction = new QAction(_("Light Time Delay"), this);
lightTimeDelayAction->setCheckable(true);
lightTimeDelayAction->setToolTip("Subtract one-way light travel time to selected object");
connect(lightTimeDelayAction, SIGNAL(triggered()), this, SLOT(slotSetLightTimeDelay()));
@ -411,14 +411,14 @@ void CelestiaActions::slotAdjustLimitingMagnitude()
renderer->setFaintestAM45deg(newLimitingMag);
appCore->setFaintestAutoMag();
notification = tr("Auto magnitude limit at 45 degrees: %L1").arg(newLimitingMag, 0, 'f', 2);
notification = QString(_("Auto magnitude limit at 45 degrees: %L1")).arg(newLimitingMag, 0, 'f', 2);
}
else
{
float newLimitingMag = qBound(1.0f, appCore->getSimulation()->getFaintestVisible() + change * 2, 15.0f);
appCore->setFaintest(newLimitingMag);
notification = tr("Magnitude limit: %L1").arg(newLimitingMag, 0, 'f', 2);
notification = QString(_("Magnitude limit: %L1")).arg(newLimitingMag, 0, 'f', 2);
}
appCore->flash(notification.toUtf8().data());

View File

@ -215,15 +215,15 @@ QVariant StarTableModel::headerData(int section, Qt::Orientation /* orientation
switch (section)
{
case 0:
return tr("Name");
return _("Name");
case 1:
return tr("Distance (ly)");
return _("Distance (ly)");
case 2:
return tr("App. mag");
return _("App. mag");
case 3:
return tr("Abs. mag");
return _("Abs. mag");
case 4:
return tr("Type");
return _("Type");
default:
return QVariant();
}
@ -498,11 +498,11 @@ CelestialBrowser::CelestialBrowser(CelestiaCore* _appCore, QWidget* parent) :
QGridLayout* starGroupLayout = new QGridLayout();
// Buttons to select filtering criterion for stars
closestButton = new QRadioButton(tr("Closest Stars"));
closestButton = new QRadioButton(_("Closest Stars"));
connect(closestButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
starGroupLayout->addWidget(closestButton, 0, 0);
brightestButton = new QRadioButton(tr("Brightest Stars"));
brightestButton = new QRadioButton(_("Brightest Stars"));
connect(brightestButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
starGroupLayout->addWidget(brightestButton, 0, 1);
@ -512,18 +512,18 @@ CelestialBrowser::CelestialBrowser(CelestiaCore* _appCore, QWidget* parent) :
closestButton->setChecked(true);
// Additional filtering controls
QGroupBox* filterGroup = new QGroupBox(tr("Filter"));
QGroupBox* filterGroup = new QGroupBox(_("Filter"));
QGridLayout* filterGroupLayout = new QGridLayout();
withPlanetsFilterBox = new QCheckBox(tr("With Planets"));
withPlanetsFilterBox = new QCheckBox(_("With Planets"));
connect(withPlanetsFilterBox, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
filterGroupLayout->addWidget(withPlanetsFilterBox, 0, 0);
multipleFilterBox = new QCheckBox(tr("Multiple Stars"));
multipleFilterBox = new QCheckBox(_("Multiple Stars"));
connect(multipleFilterBox, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
filterGroupLayout->addWidget(multipleFilterBox, 1, 0);
filterGroupLayout->addWidget(new QLabel(tr("Spectral Type")), 0, 1);
filterGroupLayout->addWidget(new QLabel(_("Spectral Type")), 0, 1);
spectralTypeFilterBox = new QLineEdit();
connect(spectralTypeFilterBox, SIGNAL(editingFinished()), this, SLOT(slotRefreshTable()));
filterGroupLayout->addWidget(spectralTypeFilterBox, 0, 2);
@ -532,59 +532,59 @@ CelestialBrowser::CelestialBrowser(CelestiaCore* _appCore, QWidget* parent) :
layout->addWidget(filterGroup);
// End filtering controls
QPushButton* refreshButton = new QPushButton(tr("Refresh"));
QPushButton* refreshButton = new QPushButton(_("Refresh"));
connect(refreshButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
layout->addWidget(refreshButton);
// Controls for marking selected objects
QGroupBox* markGroup = new QGroupBox(tr("Markers"));
QGroupBox* markGroup = new QGroupBox(_("Markers"));
QGridLayout* markGroupLayout = new QGridLayout();
QPushButton* markSelectedButton = new QPushButton(tr("Mark Selected"));
QPushButton* markSelectedButton = new QPushButton(_("Mark Selected"));
connect(markSelectedButton, SIGNAL(clicked()), this, SLOT(slotMarkSelected()));
markSelectedButton->setToolTip(tr("Mark stars selected in list view"));
markSelectedButton->setToolTip(_("Mark stars selected in list view"));
markGroupLayout->addWidget(markSelectedButton, 0, 0, 1, 2);
QPushButton* clearMarkersButton = new QPushButton(tr("Clear Markers"));
QPushButton* clearMarkersButton = new QPushButton(_("Clear Markers"));
connect(clearMarkersButton, SIGNAL(clicked()), this, SLOT(slotClearMarkers()));
clearMarkersButton->setToolTip(tr("Remove all existing markers"));
clearMarkersButton->setToolTip(_("Remove all existing markers"));
markGroupLayout->addWidget(clearMarkersButton, 0, 2, 1, 2);
markerSymbolBox = new QComboBox();
markerSymbolBox->setEditable(false);
markerSymbolBox->addItem(tr("None"));
markerSymbolBox->addItem(tr("Diamond"), (int) MarkerRepresentation::Diamond);
markerSymbolBox->addItem(tr("Triangle"), (int) MarkerRepresentation::Triangle);
markerSymbolBox->addItem(tr("Square"), (int) MarkerRepresentation::Square);
markerSymbolBox->addItem(tr("Plus"), (int) MarkerRepresentation::Plus);
markerSymbolBox->addItem(tr("X"), (int) MarkerRepresentation::X);
markerSymbolBox->addItem(tr("Circle"), (int) MarkerRepresentation::Circle);
markerSymbolBox->addItem(tr("Left Arrow"), (int) MarkerRepresentation::LeftArrow);
markerSymbolBox->addItem(tr("Right Arrow"), (int) MarkerRepresentation::RightArrow);
markerSymbolBox->addItem(tr("Up Arrow"), (int) MarkerRepresentation::UpArrow);
markerSymbolBox->addItem(tr("Down Arrow"), (int) MarkerRepresentation::DownArrow);
markerSymbolBox->addItem(_("None"));
markerSymbolBox->addItem(_("Diamond"), (int) MarkerRepresentation::Diamond);
markerSymbolBox->addItem(_("Triangle"), (int) MarkerRepresentation::Triangle);
markerSymbolBox->addItem(_("Square"), (int) MarkerRepresentation::Square);
markerSymbolBox->addItem(_("Plus"), (int) MarkerRepresentation::Plus);
markerSymbolBox->addItem(_("X"), (int) MarkerRepresentation::X);
markerSymbolBox->addItem(_("Circle"), (int) MarkerRepresentation::Circle);
markerSymbolBox->addItem(_("Left Arrow"), (int) MarkerRepresentation::LeftArrow);
markerSymbolBox->addItem(_("Right Arrow"), (int) MarkerRepresentation::RightArrow);
markerSymbolBox->addItem(_("Up Arrow"), (int) MarkerRepresentation::UpArrow);
markerSymbolBox->addItem(_("Down Arrow"), (int) MarkerRepresentation::DownArrow);
markerSymbolBox->setCurrentIndex(1);
markerSymbolBox->setToolTip(tr("Select marker symbol"));
markerSymbolBox->setToolTip(_("Select marker symbol"));
markGroupLayout->addWidget(markerSymbolBox, 1, 0);
markerSizeBox = new QComboBox();
markerSizeBox->setEditable(true);
markerSizeBox->addItem(tr("3"), 3.0);
markerSizeBox->addItem(tr("5"), 5.0);
markerSizeBox->addItem(tr("10"), 10.0);
markerSizeBox->addItem(tr("20"), 20.0);
markerSizeBox->addItem(tr("50"), 50.0);
markerSizeBox->addItem(tr("100"), 100.0);
markerSizeBox->addItem(tr("200"), 200.0);
markerSizeBox->addItem("3", 3.0);
markerSizeBox->addItem("5", 5.0);
markerSizeBox->addItem("10", 10.0);
markerSizeBox->addItem("20", 20.0);
markerSizeBox->addItem("50", 50.0);
markerSizeBox->addItem("100", 100.0);
markerSizeBox->addItem("200", 200.0);
markerSizeBox->setCurrentIndex(3);
markerSizeBox->setToolTip(tr("Select marker size"));
markerSizeBox->setToolTip(_("Select marker size"));
markGroupLayout->addWidget(markerSizeBox, 1, 1);
colorSwatch = new ColorSwatchWidget(QColor("cyan"));
colorSwatch->setToolTip(tr("Click to select marker color"));
colorSwatch->setToolTip(_("Click to select marker color"));
markGroupLayout->addWidget(colorSwatch, 1, 2);
labelMarkerBox = new QCheckBox(tr("Label"));
labelMarkerBox = new QCheckBox(_("Label"));
markGroupLayout->addWidget(labelMarkerBox, 1, 3);
markGroup->setLayout(markGroupLayout);
@ -641,7 +641,7 @@ void CelestialBrowser::slotRefreshTable()
treeView->resizeColumnToContents(StarTableModel::AppMagColumn);
treeView->resizeColumnToContents(StarTableModel::AbsMagColumn);
searchResultLabel->setText(tr("%1 objects found").arg(starModel->rowCount(QModelIndex())));
searchResultLabel->setText(QString(_("%1 objects found")).arg(starModel->rowCount(QModelIndex())));
}

View File

@ -154,7 +154,7 @@ QVariant DSOTableModel::data(const QModelIndex& index, int role) const
{
case NameColumn:
{
string dsoNameString = ReplaceGreekLetterAbbr(universe->getDSOCatalog()->getDSOName(dso));
string dsoNameString = ReplaceGreekLetterAbbr(universe->getDSOCatalog()->getDSOName(dso, true));
return QVariant(QString::fromUtf8(dsoNameString.c_str()));
}
case DistanceColumn:
@ -183,13 +183,13 @@ QVariant DSOTableModel::headerData(int section, Qt::Orientation /* orientation *
switch (section)
{
case 0:
return tr("Name");
return _("Name");
case 1:
return tr("Distance (ly)");
return _("Distance (ly)");
case 2:
return tr("App. mag");
return _("App. mag");
case 3:
return tr("Type");
return _("Type");
default:
return QVariant();
}
@ -426,19 +426,19 @@ DeepSkyBrowser::DeepSkyBrowser(CelestiaCore* _appCore, QWidget* parent) :
QGridLayout* dsoGroupLayout = new QGridLayout();
// Buttons to select filtering criterion for dsos
globularsButton = new QRadioButton(tr("Globulars"));
globularsButton = new QRadioButton(_("Globulars"));
connect(globularsButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
dsoGroupLayout->addWidget(globularsButton, 0, 0);
galaxiesButton = new QRadioButton(tr("Galaxies"));
galaxiesButton = new QRadioButton(_("Galaxies"));
connect(galaxiesButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
dsoGroupLayout->addWidget(galaxiesButton, 0, 1);
nebulaeButton = new QRadioButton(tr("Nebulae"));
nebulaeButton = new QRadioButton(_("Nebulae"));
connect(nebulaeButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
dsoGroupLayout->addWidget(nebulaeButton, 1, 0);
openClustersButton = new QRadioButton(tr("Open Clusters"));
openClustersButton = new QRadioButton(_("Open Clusters"));
connect(openClustersButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
dsoGroupLayout->addWidget(openClustersButton, 1, 1);
@ -448,10 +448,10 @@ DeepSkyBrowser::DeepSkyBrowser(CelestiaCore* _appCore, QWidget* parent) :
galaxiesButton->setChecked(true);
// Additional filtering controls
QGroupBox* filterGroup = new QGroupBox(tr("Filter"));
QGroupBox* filterGroup = new QGroupBox(_("Filter"));
QHBoxLayout* filterGroupLayout = new QHBoxLayout();
filterGroupLayout->addWidget(new QLabel(tr("Type")));
filterGroupLayout->addWidget(new QLabel(_("Type")));
objectTypeFilterBox = new QLineEdit();
connect(objectTypeFilterBox, SIGNAL(editingFinished()), this, SLOT(slotRefreshTable()));
filterGroupLayout->addWidget(objectTypeFilterBox);
@ -460,59 +460,59 @@ DeepSkyBrowser::DeepSkyBrowser(CelestiaCore* _appCore, QWidget* parent) :
layout->addWidget(filterGroup);
// End filtering controls
QPushButton* refreshButton = new QPushButton(tr("Refresh"));
QPushButton* refreshButton = new QPushButton(_("Refresh"));
connect(refreshButton, SIGNAL(clicked()), this, SLOT(slotRefreshTable()));
layout->addWidget(refreshButton);
// Controls for marking selected objects
QGroupBox* markGroup = new QGroupBox(tr("Markers"));
QGroupBox* markGroup = new QGroupBox(_("Markers"));
QGridLayout* markGroupLayout = new QGridLayout();
QPushButton* markSelectedButton = new QPushButton(tr("Mark Selected"));
markSelectedButton->setToolTip(tr("Mark DSOs selected in list view"));
QPushButton* markSelectedButton = new QPushButton(_("Mark Selected"));
markSelectedButton->setToolTip(_("Mark DSOs selected in list view"));
connect(markSelectedButton, SIGNAL(clicked()), this, SLOT(slotMarkSelected()));
markGroupLayout->addWidget(markSelectedButton, 0, 0, 1, 2);
QPushButton* clearMarkersButton = new QPushButton(tr("Clear Markers"));
QPushButton* clearMarkersButton = new QPushButton(_("Clear Markers"));
connect(clearMarkersButton, SIGNAL(clicked()), this, SLOT(slotClearMarkers()));
clearMarkersButton->setToolTip(tr("Remove all existing markers"));
clearMarkersButton->setToolTip(_("Remove all existing markers"));
markGroupLayout->addWidget(clearMarkersButton, 0, 2, 1, 2);
markerSymbolBox = new QComboBox();
markerSymbolBox->setEditable(false);
markerSymbolBox->addItem(tr("None"));
markerSymbolBox->addItem(tr("Diamond"), (int) MarkerRepresentation::Diamond);
markerSymbolBox->addItem(tr("Triangle"), (int) MarkerRepresentation::Triangle);
markerSymbolBox->addItem(tr("Square"), (int) MarkerRepresentation::Square);
markerSymbolBox->addItem(tr("Plus"), (int) MarkerRepresentation::Plus);
markerSymbolBox->addItem(tr("X"), (int) MarkerRepresentation::X);
markerSymbolBox->addItem(tr("Circle"), (int) MarkerRepresentation::Circle);
markerSymbolBox->addItem(tr("Left Arrow"), (int) MarkerRepresentation::LeftArrow);
markerSymbolBox->addItem(tr("Right Arrow"), (int) MarkerRepresentation::RightArrow);
markerSymbolBox->addItem(tr("Up Arrow"), (int) MarkerRepresentation::UpArrow);
markerSymbolBox->addItem(tr("Down Arrow"), (int) MarkerRepresentation::DownArrow);
markerSymbolBox->addItem(_("None"));
markerSymbolBox->addItem(_("Diamond"), (int) MarkerRepresentation::Diamond);
markerSymbolBox->addItem(_("Triangle"), (int) MarkerRepresentation::Triangle);
markerSymbolBox->addItem(_("Square"), (int) MarkerRepresentation::Square);
markerSymbolBox->addItem(_("Plus"), (int) MarkerRepresentation::Plus);
markerSymbolBox->addItem(_("X"), (int) MarkerRepresentation::X);
markerSymbolBox->addItem(_("Circle"), (int) MarkerRepresentation::Circle);
markerSymbolBox->addItem(_("Left Arrow"), (int) MarkerRepresentation::LeftArrow);
markerSymbolBox->addItem(_("Right Arrow"), (int) MarkerRepresentation::RightArrow);
markerSymbolBox->addItem(_("Up Arrow"), (int) MarkerRepresentation::UpArrow);
markerSymbolBox->addItem(_("Down Arrow"), (int) MarkerRepresentation::DownArrow);
markerSymbolBox->setCurrentIndex(1);
markerSymbolBox->setToolTip(tr("Select marker symbol"));
markerSymbolBox->setToolTip(_("Select marker symbol"));
markGroupLayout->addWidget(markerSymbolBox, 1, 0);
markerSizeBox = new QComboBox();
markerSizeBox->setEditable(true);
markerSizeBox->addItem(tr("3"), 3.0);
markerSizeBox->addItem(tr("5"), 5.0);
markerSizeBox->addItem(tr("10"), 10.0);
markerSizeBox->addItem(tr("20"), 20.0);
markerSizeBox->addItem(tr("50"), 50.0);
markerSizeBox->addItem(tr("100"), 100.0);
markerSizeBox->addItem(tr("200"), 200.0);
markerSizeBox->addItem("3", 3.0);
markerSizeBox->addItem("5", 5.0);
markerSizeBox->addItem("10", 10.0);
markerSizeBox->addItem("20", 20.0);
markerSizeBox->addItem("50", 50.0);
markerSizeBox->addItem("100", 100.0);
markerSizeBox->addItem("200", 200.0);
markerSizeBox->setCurrentIndex(3);
markerSizeBox->setToolTip(tr("Select marker size"));
markerSizeBox->setToolTip(_("Select marker size"));
markGroupLayout->addWidget(markerSizeBox, 1, 1);
colorSwatch = new ColorSwatchWidget(QColor("cyan"));
colorSwatch->setToolTip(tr("Click to select marker color"));
colorSwatch->setToolTip(_("Click to select marker color"));
markGroupLayout->addWidget(colorSwatch, 1, 2);
labelMarkerBox = new QCheckBox(tr("Label"));
labelMarkerBox = new QCheckBox(_("Label"));
markGroupLayout->addWidget(labelMarkerBox, 1, 3);
markGroup->setLayout(markGroupLayout);
@ -569,7 +569,7 @@ void DeepSkyBrowser::slotRefreshTable()
treeView->resizeColumnToContents(DSOTableModel::DistanceColumn);
treeView->resizeColumnToContents(DSOTableModel::AppMagColumn);
searchResultLabel->setText(tr("%1 objects found").arg(dsoModel->rowCount(QModelIndex())));
searchResultLabel->setText(QString(_("%1 objects found")).arg(dsoModel->rowCount(QModelIndex())));
}
@ -615,7 +615,7 @@ void DeepSkyBrowser::slotMarkSelected()
{
if (labelMarker)
{
label = universe->getDSOCatalog()->getDSOName(dso);
label = universe->getDSOCatalog()->getDSOName(dso, true);
label = ReplaceGreekLetterAbbr(label);
}

View File

@ -433,9 +433,9 @@ QVariant EventTableModel::data(const QModelIndex& index, int role) const
switch (index.column())
{
case ReceiverColumn:
return QString(eclipse.receiver->getName().c_str());
return QString(eclipse.receiver->getName(true).c_str());
case OcculterColumn:
return QString(eclipse.occulter->getName().c_str());
return QString(eclipse.occulter->getName(true).c_str());
case StartTimeColumn:
return TDBToQDate(eclipse.startTime).toUTC().toString("dd MMM yyyy hh:mm");
case DurationColumn:
@ -463,13 +463,13 @@ QVariant EventTableModel::headerData(int section, Qt::Orientation, int role) con
switch (section)
{
case 0:
return tr("Eclipsed body");
return _("Eclipsed body");
case 1:
return tr("Occulter");
return _("Occulter");
case 2:
return tr("Start time");
return _("Start time");
case 3:
return tr("Duration");
return _("Duration");
default:
return QVariant();
}
@ -566,9 +566,9 @@ EventFinder::EventFinder(CelestiaCore* _appCore,
// Create the eclipse type box
QWidget* eclipseTypeBox = new QWidget();
QVBoxLayout* eclipseTypeLayout = new QVBoxLayout();
solarOnlyButton = new QRadioButton(tr("Solar eclipses"));
lunarOnlyButton = new QRadioButton(tr("Lunar eclipses"));
allEclipsesButton = new QRadioButton(tr("All eclipses"));
solarOnlyButton = new QRadioButton(_("Solar eclipses"));
lunarOnlyButton = new QRadioButton(_("Lunar eclipses"));
allEclipsesButton = new QRadioButton(_("All eclipses"));
eclipseTypeLayout->addWidget(solarOnlyButton);
eclipseTypeLayout->addWidget(lunarOnlyButton);
@ -576,7 +576,7 @@ EventFinder::EventFinder(CelestiaCore* _appCore,
eclipseTypeBox->setLayout(eclipseTypeLayout);
// Search the search range box
QGroupBox* searchRangeBox = new QGroupBox(tr("Search range"));
QGroupBox* searchRangeBox = new QGroupBox(_("Search range"));
QVBoxLayout* searchRangeLayout = new QVBoxLayout();
startDateEdit = new QDateEdit(searchRangeBox);
@ -598,15 +598,15 @@ EventFinder::EventFinder(CelestiaCore* _appCore,
layout->addWidget(subgroup);
planetSelect = new QComboBox();
planetSelect->addItem("Earth");
planetSelect->addItem("Jupiter");
planetSelect->addItem("Saturn");
planetSelect->addItem("Uranus");
planetSelect->addItem("Neptune");
planetSelect->addItem("Pluto");
planetSelect->addItem(_("Earth"));
planetSelect->addItem(_("Jupiter"));
planetSelect->addItem(_("Saturn"));
planetSelect->addItem(_("Uranus"));
planetSelect->addItem(_("Neptune"));
planetSelect->addItem(_("Pluto"));
layout->addWidget(planetSelect);
QPushButton* findButton = new QPushButton(tr("Find eclipses"));
QPushButton* findButton = new QPushButton(_("Find eclipses"));
connect(findButton, SIGNAL(clicked()), this, SLOT(slotFindEclipses()));
layout->addWidget(findButton);
@ -665,12 +665,13 @@ void EventFinder::slotFindEclipses()
eclipseTypeMask = QtEclipseFinder::SolarEclipse | QtEclipseFinder::LunarEclipse;
QString bodyName = QString("Sol/") + planetSelect->currentText();
Selection obj = appCore->getSimulation()->getUniverse()->findPath(bodyName.toUtf8().data());
Selection obj = appCore->getSimulation()->findObjectFromPath(bodyName.toUtf8().data(), true);
if (obj.body() == NULL)
{
QMessageBox::critical(this,
tr("Event Finder"),
tr("%1 is not a valid object").arg(planetSelect->currentText()));
_("Event Finder"),
QString(_("%1 is not a valid object")).arg(planetSelect->currentText()));
return;
}
@ -680,8 +681,8 @@ void EventFinder::slotFindEclipses()
if (startDate > endDate)
{
QMessageBox::critical(this,
tr("Event Finder"),
tr("End date is earlier than start date."));
_("Event Finder"),
_("End date is earlier than start date."));
return;
}
@ -695,7 +696,7 @@ void EventFinder::slotFindEclipses()
searchSpan = endTimeTDB - startTimeTDB;
lastProgressUpdate = startTimeTDB;
progress = new QProgressDialog(tr("Finding eclipses..."), "Abort", (int) startTimeTDB, (int) endTimeTDB, this);
progress = new QProgressDialog(_("Finding eclipses..."), "Abort", (int) startTimeTDB, (int) endTimeTDB, this);
progress->setWindowModality(Qt::WindowModal);
progress->show();
@ -726,23 +727,23 @@ void EventFinder::slotContextMenu(const QPoint& pos)
contextMenu = new QMenu(this);
contextMenu->clear();
QAction* setTimeAction = new QAction("Set time to mid-eclipse", contextMenu);
QAction* setTimeAction = new QAction(_("Set time to mid-eclipse"), contextMenu);
connect(setTimeAction, SIGNAL(triggered()), this, SLOT(slotSetEclipseTime()));
contextMenu->addAction(setTimeAction);
QAction* viewNearEclipsedAction = new QAction(QString("Near %1").arg(activeEclipse->receiver->getName().c_str()), contextMenu);
QAction* viewNearEclipsedAction = new QAction(QString(_("Near %1")).arg(activeEclipse->receiver->getName(true).c_str()), contextMenu);
connect(viewNearEclipsedAction, SIGNAL(triggered()), this, SLOT(slotViewNearEclipsed()));
contextMenu->addAction(viewNearEclipsedAction);
QAction* viewEclipsedSurfaceAction = new QAction(QString("From surface of %1").arg(activeEclipse->receiver->getName().c_str()), contextMenu);
QAction* viewEclipsedSurfaceAction = new QAction(QString(_("From surface of %1")).arg(activeEclipse->receiver->getName(true).c_str()), contextMenu);
connect(viewEclipsedSurfaceAction, SIGNAL(triggered()), this, SLOT(slotViewEclipsedSurface()));
contextMenu->addAction(viewEclipsedSurfaceAction);
QAction* viewOccluderSurfaceAction = new QAction(QString("From surface of %1").arg(activeEclipse->occulter->getName().c_str()), contextMenu);
QAction* viewOccluderSurfaceAction = new QAction(QString(_("From surface of %1")).arg(activeEclipse->occulter->getName(true).c_str()), contextMenu);
connect(viewOccluderSurfaceAction, SIGNAL(triggered()), this, SLOT(slotViewOccluderSurface()));
contextMenu->addAction(viewOccluderSurfaceAction);
QAction* viewBehindOccluderAction = new QAction(QString("Behind %1").arg(activeEclipse->occulter->getName().c_str()), contextMenu);
QAction* viewBehindOccluderAction = new QAction(QString(_("Behind %1")).arg(activeEclipse->occulter->getName(true).c_str()), contextMenu);
connect(viewBehindOccluderAction, SIGNAL(triggered()), this, SLOT(slotViewBehindOccluder()));
contextMenu->addAction(viewBehindOccluderAction);

View File

@ -112,37 +112,37 @@ void InfoPanel::buildSolarSystemBodyPage(const Body* body,
double t,
QTextStream& stream)
{
stream << "<h1>" << body->getName().c_str() << "</h1><br>\n";
stream << "<h1>" <<QString::fromUtf8(body->getName(true).c_str()) << "</h1><br>\n";
if (!body->getInfoURL().empty())
{
const char* infoURL = body->getInfoURL().c_str();
stream << tr("Web info: ") << anchor(infoURL, infoURL) << "<br>\n";
stream << _("Web info: ") << anchor(infoURL, infoURL) << "<br>\n";
}
stream << "<br>\n";
bool isArtificial = body->getClassification() == Body::Spacecraft;
QString units(tr("km"));
QString units(_("km"));
double radius = body->getRadius();
if (radius < 1.0)
{
units = tr("m");
units = _("m");
radius *= 1000.0;
}
if (body->isEllipsoid())
stream << boldText(tr("Equatorial radius: "));
stream << boldText(_("Equatorial radius: "));
else
stream << boldText(tr("Size: "));
stream << boldText(_("Size: "));
stream << radius << " " << units << "<br>";
#if 0
if (body->getOblateness() != 0.0f && body->isEllipsoid())
{
stream << boldText(tr("Oblateness: ")) << body->getOblateness() << "<br>\n";
stream << boldText(_("Oblateness: ")) << body->getOblateness() << "<br>\n";
}
#endif
@ -170,17 +170,17 @@ void InfoPanel::buildSolarSystemBodyPage(const Body* body,
{
rotPeriod *= 24.0;
dayLength *= 24.0;
units = tr("hours");
units = _("hours");
}
else
{
units = tr("days");
units = _("days");
}
stream << boldText(tr("Sidereal rotation period: ")) << rotPeriod << " " << units << "<br>\n";
stream << boldText(_("Sidereal rotation period: ")) << rotPeriod << " " << units << "<br>\n";
if (dayLength != 0.0)
{
stream << boldText(tr("Length of day: ")) << dayLength << " " << units << "<br>\n";
stream << boldText(_("Length of day: ")) << dayLength << " " << units << "<br>\n";
}
}
@ -198,41 +198,41 @@ void InfoPanel::buildSolarSystemBodyPage(const Body* body,
if (orbitalPeriod < 365.25 * 2.0)
{
units = tr("days");
units = _("days");
}
else
{
units = tr("years");
units = _("years");
orbitalPeriod /= 365.25;
}
stream << "<br><big><b>" << tr("Orbit information") << "</b></big><br>\n";
stream << tr("Osculating elements for") << " " << astro::TDBtoUTC(t).toCStr() << "<br>\n";
stream << "<br><big><b>" << QString(_("Orbit information")) << "</b></big><br>\n";
stream << QString(_("Osculating elements for")) << " " << QString::fromUtf8(astro::TDBtoUTC(t).toCStr()) << "<br>\n";
stream << "<i>[ Orbit reference plane info goes here ]</i><br>\n";
stream << boldText(tr("Period: ")) << orbitalPeriod << " " << units << "<br>\n";
stream << boldText(_("Period: ")) << orbitalPeriod << " " << units << "<br>\n";
double sma = elements.semimajorAxis;
if (sma > 2.5e7)
{
units = tr("AU");
units = _("AU");
sma = astro::kilometersToAU(sma);
}
else
{
units = tr("km");
units = _("km");
}
stream << boldText(tr("Semi-major axis: ")) << sma << " " << units << "<br>\n";
stream << boldText(tr("Eccentricity: ")) << elements.eccentricity << "<br>\n";
stream << boldText(tr("Inclination: ")) << radToDeg(elements.inclination) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(tr("Pericenter distance: ")) << sma * (1 - elements.eccentricity) << " " << units << "<br>\n";
stream << boldText(tr("Apocenter distance: ")) << sma * (1 + elements.eccentricity) << " " << units << "<br>\n";
stream << boldText(_("Semi-major axis: ")) << sma << " " << units << "<br>\n";
stream << boldText(_("Eccentricity: ")) << elements.eccentricity << "<br>\n";
stream << boldText(_("Inclination: ")) << radToDeg(elements.inclination) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(_("Pericenter distance: ")) << sma * (1 - elements.eccentricity) << " " << units << "<br>\n";
stream << boldText(_("Apocenter distance: ")) << sma * (1 + elements.eccentricity) << " " << units << "<br>\n";
#if 1
stream << boldText(tr("Ascending node: ")) << radToDeg(elements.longAscendingNode) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(tr("Argument of periapsis: ")) << radToDeg(elements.argPericenter) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(tr("Mean anomaly: ")) << radToDeg(elements.meanAnomaly) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(tr("Period (calculated): ")) << elements.period << "d<br>\n";
stream << boldText(_("Ascending node: ")) << radToDeg(elements.longAscendingNode) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(_("Argument of periapsis: ")) << radToDeg(elements.argPericenter) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(_("Mean anomaly: ")) << radToDeg(elements.meanAnomaly) << QString::fromUtf8(UTF8_DEGREE_SIGN) << "<br>\n";
stream << boldText(_("Period (calculated): ")) << elements.period << " " << QString(_("days<br>\n"));
#endif
}
}
@ -258,8 +258,8 @@ Vector3d rectToSpherical(const Vector3d& v)
void InfoPanel::buildStarPage(const Star* star, const Universe* universe, double tdb, QTextStream& stream)
{
string name = universe->getStarCatalog()->getStarNameList(*star);
stream << "<b>" << QString::fromUtf8(name.c_str(), name.length()) << "</b><br>\n";
string name = ReplaceGreekLetterAbbr(universe->getStarCatalog()->getStarName(*star, true));
stream << "<h1>" << QString::fromUtf8(name.c_str()) << "</h1><br>\n";
// Compute the star's position relative to the Solar System Barycenter. Note that
// this will ignore the effect of parallax in the star's position.
@ -287,8 +287,8 @@ void InfoPanel::buildDSOPage(const DeepSkyObject* dso,
const Universe* universe,
QTextStream& stream)
{
string name = universe->getDSOCatalog()->getDSOName(dso);
stream << "<h1>" << name.c_str() << "</h1><br>\n";
string name = universe->getDSOCatalog()->getDSOName(dso, true);
stream << "<h1>" << QString::fromUtf8(name.c_str()) << "</h1><br>\n";
Vector3d eqPos = astro::eclipticToEquatorial(celToJ2000Ecliptic(dso->getPosition()));
Vector3d sph = rectToSpherical(eqPos);

View File

@ -22,6 +22,7 @@
#include <QBitmap>
#include <vector>
#include "qtappwin.h"
#include <qtextcodec.h>
using namespace std;
@ -59,6 +60,19 @@ int main(int argc, char *argv[])
// are resolved
//splash.show();
// Gettext integration
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
bindtextdomain("celestia","locale");
bind_textdomain_codeset("celestia", "UTF-8");
bindtextdomain("celestia_constellations","locale");
bind_textdomain_codeset("celestia_constellations", "UTF-8");
textdomain("celestia");
// By default, QString converts the const char * data into Unicode Latin-1 characters.
// We need to change this to UTF-8 for i18n purpose.
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
CelestiaAppWindow window;
// Connect the splash screen to the main window so that it

View File

@ -53,9 +53,9 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
QWidget* locationsPage = new QWidget();
QWidget* timePage = new QWidget();
tabWidget->addTab(renderPage, "Rendering");
tabWidget->addTab(locationsPage, "Locations");
tabWidget->addTab(timePage, "Time");
tabWidget->addTab(renderPage, _("Rendering"));
tabWidget->addTab(locationsPage, _("Locations"));
tabWidget->addTab(timePage, _("Time"));
// Render page
int renderFlags = appCore->getRenderer()->getRenderFlags();
@ -63,31 +63,31 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
renderPage->setLayout(renderPageLayout);
// Objects group
QGroupBox* objectsGroup = new QGroupBox(tr("Objects"));
QGroupBox* objectsGroup = new QGroupBox(_("Objects"));
QVBoxLayout* objectsGroupLayout = new QVBoxLayout();
objectsGroup->setLayout(objectsGroupLayout);
QCheckBox* showStarsCheck = new QCheckBox(tr("Stars"));
QCheckBox* showStarsCheck = new QCheckBox(_("Stars"));
connect(showStarsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowStars(bool)));
showStarsCheck->setChecked(renderFlags & Renderer::ShowStars);
objectsGroupLayout->addWidget(showStarsCheck);
QCheckBox* showPlanetsCheck = new QCheckBox(tr("Planets"));
QCheckBox* showPlanetsCheck = new QCheckBox(_("Planets"));
connect(showPlanetsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowPlanets(bool)));
showPlanetsCheck->setChecked(renderFlags & Renderer::ShowPlanets);
objectsGroupLayout->addWidget(showPlanetsCheck);
QCheckBox* showGalaxiesCheck = new QCheckBox(tr("Galaxies"));
QCheckBox* showGalaxiesCheck = new QCheckBox(_("Galaxies"));
connect(showGalaxiesCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowGalaxies(bool)));
showGalaxiesCheck->setChecked(renderFlags & Renderer::ShowGalaxies);
objectsGroupLayout->addWidget(showGalaxiesCheck);
QCheckBox* showNebulaeCheck = new QCheckBox(tr("Nebulae"));
QCheckBox* showNebulaeCheck = new QCheckBox(_("Nebulae"));
connect(showNebulaeCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowNebulae(bool)));
showNebulaeCheck->setChecked(renderFlags & Renderer::ShowNebulae);
objectsGroupLayout->addWidget(showNebulaeCheck);
QCheckBox* showOpenClustersCheck = new QCheckBox(tr("Open Clusters"));
QCheckBox* showOpenClustersCheck = new QCheckBox(_("Open Clusters"));
connect(showOpenClustersCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowOpenClusters(bool)));
showOpenClustersCheck->setChecked(renderFlags & Renderer::ShowOpenClusters);
objectsGroupLayout->addWidget(showOpenClustersCheck);
@ -95,41 +95,41 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
objectsGroupLayout->addStretch();
// Features group
QGroupBox* featuresGroup = new QGroupBox(tr("Features"));
QGroupBox* featuresGroup = new QGroupBox(_("Features"));
QVBoxLayout* featuresGroupLayout = new QVBoxLayout();
featuresGroup->setLayout(featuresGroupLayout);
QCheckBox* showAtmospheresCheck = new QCheckBox(tr("Atmospheres"));
QCheckBox* showAtmospheresCheck = new QCheckBox(_("Atmospheres"));
connect(showAtmospheresCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowAtmospheres(bool)));
showAtmospheresCheck->setChecked(renderFlags & Renderer::ShowAtmospheres);
featuresGroupLayout->addWidget(showAtmospheresCheck);
QCheckBox* showCloudMapsCheck = new QCheckBox(tr("Clouds"));
QCheckBox* showCloudMapsCheck = new QCheckBox(_("Clouds"));
connect(showCloudMapsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowCloudMaps(bool)));
showCloudMapsCheck->setChecked(renderFlags & Renderer::ShowCloudMaps);
featuresGroupLayout->addWidget(showCloudMapsCheck);
QCheckBox* showNightMapsCheck = new QCheckBox(tr("Night Side Lights"));
QCheckBox* showNightMapsCheck = new QCheckBox(_("Night Side Lights"));
connect(showNightMapsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowNightMaps(bool)));
showNightMapsCheck->setChecked(renderFlags & Renderer::ShowNightMaps);
featuresGroupLayout->addWidget(showNightMapsCheck);
QCheckBox* showEclipseShadowsCheck = new QCheckBox(tr("Eclipse Shadows"));
QCheckBox* showEclipseShadowsCheck = new QCheckBox(_("Eclipse Shadows"));
connect(showEclipseShadowsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowEclipseShadows(bool)));
showEclipseShadowsCheck->setChecked(renderFlags & Renderer::ShowEclipseShadows);
featuresGroupLayout->addWidget(showEclipseShadowsCheck);
QCheckBox* showRingShadowsCheck = new QCheckBox(tr("Ring Shadows"));
QCheckBox* showRingShadowsCheck = new QCheckBox(_("Ring Shadows"));
connect(showRingShadowsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowRingShadows(bool)));
showRingShadowsCheck->setChecked(renderFlags & Renderer::ShowRingShadows);
featuresGroupLayout->addWidget(showRingShadowsCheck);
QCheckBox* showCloudShadowsCheck = new QCheckBox(tr("Cloud Shadows"));
QCheckBox* showCloudShadowsCheck = new QCheckBox(_("Cloud Shadows"));
connect(showCloudShadowsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowCloudShadows(bool)));
showCloudShadowsCheck->setChecked(renderFlags & Renderer::ShowCloudShadows);
featuresGroupLayout->addWidget(showCloudShadowsCheck);
QCheckBox* showCometTailsCheck = new QCheckBox(tr("Comet Tails"));
QCheckBox* showCometTailsCheck = new QCheckBox(_("Comet Tails"));
connect(showCometTailsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowCometTails(bool)));
showCometTailsCheck->setChecked(renderFlags & Renderer::ShowCometTails);
featuresGroupLayout->addWidget(showCometTailsCheck);
@ -137,41 +137,41 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
featuresGroupLayout->addStretch();
// Guides group
QGroupBox* guidesGroup = new QGroupBox(tr("Guides"));
QGroupBox* guidesGroup = new QGroupBox(_("Guides"));
QVBoxLayout* guidesGroupLayout = new QVBoxLayout();
guidesGroup->setLayout(guidesGroupLayout);
QCheckBox* showOrbitsCheck = new QCheckBox(tr("Orbits"));
QCheckBox* showOrbitsCheck = new QCheckBox(_("Orbits"));
connect(showOrbitsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowOrbits(bool)));
showOrbitsCheck->setChecked(renderFlags & Renderer::ShowOrbits);
guidesGroupLayout->addWidget(showOrbitsCheck);
QCheckBox* showPartialTrajectoriesCheck = new QCheckBox(tr("Partial Trajectories"));
QCheckBox* showPartialTrajectoriesCheck = new QCheckBox(_("Partial Trajectories"));
connect(showPartialTrajectoriesCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowPartialTrajectories(bool)));
showPartialTrajectoriesCheck->setChecked(renderFlags & Renderer::ShowPartialTrajectories);
guidesGroupLayout->addWidget(showPartialTrajectoriesCheck);
QCheckBox* showSmoothLinesCheck = new QCheckBox(tr("Smooth Orbit Lines"));
QCheckBox* showSmoothLinesCheck = new QCheckBox(_("Smooth Orbit Lines"));
connect(showSmoothLinesCheck, SIGNAL(clicked(bool)), this, SLOT(slotSmoothLines(bool)));
showSmoothLinesCheck->setChecked(renderFlags & Renderer::ShowSmoothLines);
guidesGroupLayout->addWidget(showSmoothLinesCheck);
QCheckBox* showCelestialSphereCheck = new QCheckBox(tr("Equatorial Grid"));
QCheckBox* showCelestialSphereCheck = new QCheckBox(_("Equatorial Grid"));
connect(showCelestialSphereCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowCelestialSphere(bool)));
showCelestialSphereCheck->setChecked(renderFlags & Renderer::ShowCelestialSphere);
guidesGroupLayout->addWidget(showCelestialSphereCheck);
QCheckBox* showMarkersCheck = new QCheckBox(tr("Markers"));
QCheckBox* showMarkersCheck = new QCheckBox(_("Markers"));
connect(showMarkersCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowMarkers(bool)));
showMarkersCheck->setChecked(renderFlags & Renderer::ShowMarkers);
guidesGroupLayout->addWidget(showMarkersCheck);
QCheckBox* showDiagramsCheck = new QCheckBox(tr("Constellations"));
QCheckBox* showDiagramsCheck = new QCheckBox(_("Constellations"));
connect(showDiagramsCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowDiagrams(bool)));
showDiagramsCheck->setChecked(renderFlags & Renderer::ShowDiagrams);
guidesGroupLayout->addWidget(showDiagramsCheck);
QCheckBox* showBoundariesCheck = new QCheckBox(tr("Constellation Boundaries"));
QCheckBox* showBoundariesCheck = new QCheckBox(_("Constellation Boundaries"));
connect(showBoundariesCheck, SIGNAL(clicked(bool)), this, SLOT(slotShowBoundaries(bool)));
showBoundariesCheck->setChecked(renderFlags & Renderer::ShowBoundaries);
guidesGroupLayout->addWidget(showBoundariesCheck);
@ -185,16 +185,16 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
QGridLayout* timeLayout = new QGridLayout();
timeLayout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
QLabel* dateFormatLabel = new QLabel(tr("Date Format: "));
QLabel* dateFormatLabel = new QLabel(_("Date Format: "));
timeLayout->addWidget(dateFormatLabel, 0, 0);
dateFormatBox = new QComboBox(this);
dateFormatBox->setEditable(false);
#ifndef _WIN32
dateFormatBox->addItem(tr("Local Format"), 0);
dateFormatBox->addItem(_("Local Format"), 0);
#endif
dateFormatBox->addItem(tr("Time Zone Name"), 1);
dateFormatBox->addItem(tr("UTC Offset"), 2);
dateFormatBox->addItem(_("Time Zone Name"), 1);
dateFormatBox->addItem(_("UTC Offset"), 2);
astro::Date::Format dateFormat = appCore->getDateFormat();
#ifndef _WIN32
@ -203,7 +203,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
dateFormatBox->setCurrentIndex(dateFormat == 2 ? 1 : 0);
#endif
dateFormatBox->setToolTip(tr("Select Date Format"));
dateFormatBox->setToolTip(_("Select Date Format"));
timeLayout->addWidget(dateFormatBox, 0, 1);
connect(dateFormatBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotDateFormatChanged()));
@ -211,7 +211,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
#if 0
// TODO: Make a page dedicated to star brightness control
QCheckBox* showAutoMagCheck = new QCheckBox(tr("Auto Magnitudes"));
QCheckBox* showAutoMagCheck = new QCheckBox(_("Auto Magnitudes"));
showAutoMagCheck->setChecked(renderFlags & Renderer::ShowAutoMag);
objectsGroupLayout->addWidget(showAutoMagCheck);
#endif
@ -555,96 +555,96 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
// KDialogBase (KDialogBase::IconList, "",
// KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel, KDialogBase::Ok,parent)
{
setWindowTitle(tr("Celestia Preferences"));
setWindowTitle(_("Celestia Preferences"));
appCore = core;
this->parent = (CelestiaAppWindow*) parent;
// Render page
QWidget* renderFrame = addGridPage(2, Qt::Horizontal, tr("Rendering"), tr("Rendering"));
QWidget* renderFrame = addGridPage(2, Qt::Horizontal, _("Rendering"), _("Rendering"));
int renderFlags = appCore->getRenderer()->getRenderFlags();
savedRendererFlags = renderFlags;
QGroupBox* showGroup = new QGroupBox(1, Qt::Horizontal, tr("Objects"), renderFrame);
QGroupBox* showGroup = new QGroupBox(1, Qt::Horizontal, _("Objects"), renderFrame);
QCheckBox* showStarsCheck = new QCheckBox(tr("Stars"), showGroup);
QCheckBox* showStarsCheck = new QCheckBox(_("Stars"), showGroup);
//actionColl->action("showStars")->connect(showStarsCheck, SIGNAL(clicked()), SLOT(activate()));
showStarsCheck->setChecked(renderFlags & Renderer::ShowStars);
QCheckBox* showAutoMagCheck = new QCheckBox(tr("Auto Magnitudes"), showGroup);
QCheckBox* showAutoMagCheck = new QCheckBox(_("Auto Magnitudes"), showGroup);
//actionColl->action("showAutoMag")->connect(showAutoMagCheck, SIGNAL(clicked()), SLOT(activate()));
showAutoMagCheck->setChecked(renderFlags & Renderer::ShowAutoMag);
QCheckBox* showPlanetsCheck = new QCheckBox(tr("Planets"), showGroup);
QCheckBox* showPlanetsCheck = new QCheckBox(_("Planets"), showGroup);
//actionColl->action("showPlanets")->connect(showPlanetsCheck, SIGNAL(clicked()), SLOT(activate()));
showPlanetsCheck->setChecked(renderFlags & Renderer::ShowPlanets);
QCheckBox* showGalaxiesCheck = new QCheckBox(tr("Galaxies"), showGroup);
QCheckBox* showGalaxiesCheck = new QCheckBox(_("Galaxies"), showGroup);
//actionColl->action("showGalaxies")->connect(showGalaxiesCheck, SIGNAL(clicked()), SLOT(activate()));
showGalaxiesCheck->setChecked(renderFlags & Renderer::ShowGalaxies);
QCheckBox* showNebulaeCheck = new QCheckBox(tr("Nebulae"), showGroup);
QCheckBox* showNebulaeCheck = new QCheckBox(_("Nebulae"), showGroup);
//actionColl->action("showNebulae")->connect(showNebulaeCheck, SIGNAL(clicked()), SLOT(activate()));
showNebulaeCheck->setChecked(renderFlags & Renderer::ShowNebulae);
QCheckBox* showOpenClustersCheck = new QCheckBox(tr("Open Clusters"), showGroup);
QCheckBox* showOpenClustersCheck = new QCheckBox(_("Open Clusters"), showGroup);
//actionColl->action("showOpenClusters")->connect(showOpenClustersCheck, SIGNAL(clicked()), SLOT(activate()));
showOpenClustersCheck->setChecked(renderFlags & Renderer::ShowOpenClusters);
QCheckBox* showAtmospheresCheck = new QCheckBox(tr("Atmospheres"), showGroup);
QCheckBox* showAtmospheresCheck = new QCheckBox(_("Atmospheres"), showGroup);
//actionColl->action("showAtmospheres")->connect(showAtmospheresCheck, SIGNAL(clicked()), SLOT(activate()));
showAtmospheresCheck->setChecked(renderFlags & Renderer::ShowAtmospheres);
QCheckBox* showCloudMapsCheck = new QCheckBox(tr("Clouds"), showGroup);
QCheckBox* showCloudMapsCheck = new QCheckBox(_("Clouds"), showGroup);
//actionColl->action("showCloudMaps")->connect(showCloudMapsCheck, SIGNAL(clicked()), SLOT(activate()));
showCloudMapsCheck->setChecked(renderFlags & Renderer::ShowCloudMaps);
QCheckBox* showCloudShadowsCheck = new QCheckBox(tr("Cloud Shadows"), showGroup);
QCheckBox* showCloudShadowsCheck = new QCheckBox(_("Cloud Shadows"), showGroup);
//actionColl->action("showCloudShadows")->connect(showCloudShadowsCheck, SIGNAL(clicked()), SLOT(activate()));
showCloudShadowsCheck->setChecked(renderFlags & Renderer::ShowCloudShadows);
QCheckBox* showNightMapsCheck = new QCheckBox(tr("Night Side Lights"), showGroup);
QCheckBox* showNightMapsCheck = new QCheckBox(_("Night Side Lights"), showGroup);
//actionColl->action("showNightMaps")->connect(showNightMapsCheck, SIGNAL(clicked()), SLOT(activate()));
showNightMapsCheck->setChecked(renderFlags & Renderer::ShowNightMaps);
QCheckBox* showEclipseShadowsCheck = new QCheckBox(tr("Eclipse Shadows"), showGroup);
QCheckBox* showEclipseShadowsCheck = new QCheckBox(_("Eclipse Shadows"), showGroup);
//actionColl->action("showEclipseShadows")->connect(showEclipseShadowsCheck, SIGNAL(clicked()), SLOT(activate()));
showEclipseShadowsCheck->setChecked(renderFlags & Renderer::ShowEclipseShadows);
QCheckBox* showCometTailsCheck = new QCheckBox(tr("Comet Tails"), showGroup);
QCheckBox* showCometTailsCheck = new QCheckBox(_("Comet Tails"), showGroup);
//actionColl->action("showCometTails")->connect(showCometTailsCheck, SIGNAL(clicked()), SLOT(activate()));
showCometTailsCheck->setChecked(renderFlags & Renderer::ShowCometTails);
QCheckBox* showOrbitsCheck = new QCheckBox(tr("Orbits"), showGroup);
QCheckBox* showOrbitsCheck = new QCheckBox(_("Orbits"), showGroup);
//actionColl->action("showOrbits")->connect(showOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showOrbitsCheck->setChecked(renderFlags & Renderer::ShowOrbits);
QCheckBox* showPartialTrajectoriesCheck = new QCheckBox(tr("Partial Trajectories"), showGroup);
QCheckBox* showPartialTrajectoriesCheck = new QCheckBox(_("Partial Trajectories"), showGroup);
//actionColl->action("showPartialTrajectories")->connect(showPartialTrajectoriesCheck, SIGNAL(clicked()), SLOT(activate()));
showPartialTrajectoriesCheck->setChecked(renderFlags & Renderer::ShowPartialTrajectories);
QCheckBox* showSmoothLinesCheck = new QCheckBox(tr("Smooth Orbit Lines"), showGroup);
QCheckBox* showSmoothLinesCheck = new QCheckBox(_("Smooth Orbit Lines"), showGroup);
//actionColl->action("showSmoothLines")->connect(showSmoothLinesCheck, SIGNAL(clicked()), SLOT(activate()));
showSmoothLinesCheck->setChecked(renderFlags & Renderer::ShowSmoothLines);
QCheckBox* showCelestialSphereCheck = new QCheckBox(tr("Equatorial Grid"), showGroup);
QCheckBox* showCelestialSphereCheck = new QCheckBox(_("Equatorial Grid"), showGroup);
//actionColl->action("showCelestialSphere")->connect(showCelestialSphereCheck, SIGNAL(clicked()), SLOT(activate()));
showCelestialSphereCheck->setChecked(renderFlags & Renderer::ShowCelestialSphere);
QCheckBox* showDiagramsCheck = new QCheckBox(tr("Constellations"), showGroup);
QCheckBox* showDiagramsCheck = new QCheckBox(_("Constellations"), showGroup);
//actionColl->action("showDiagrams")->connect(showDiagramsCheck, SIGNAL(clicked()), SLOT(activate()));
showDiagramsCheck->setChecked(renderFlags & Renderer::ShowDiagrams);
QCheckBox* showMarkersCheck = new QCheckBox(tr("Markers"), showGroup);
QCheckBox* showMarkersCheck = new QCheckBox(_("Markers"), showGroup);
//actionColl->action("showMarkers")->connect(showMarkersCheck, SIGNAL(clicked()), SLOT(activate()));
showMarkersCheck->setChecked(renderFlags & Renderer::ShowMarkers);
QCheckBox* showRingShadowsCheck = new QCheckBox(tr("Ring Shadows"), showGroup);
QCheckBox* showRingShadowsCheck = new QCheckBox(_("Ring Shadows"), showGroup);
//actionColl->action("showRingShadows")->connect(showRingShadowsCheck, SIGNAL(clicked()), SLOT(activate()));
showRingShadowsCheck->setChecked(renderFlags & Renderer::ShowRingShadows);
QCheckBox* showBoundariesCheck = new QCheckBox(tr("Constellation Boundaries"), showGroup);
QCheckBox* showBoundariesCheck = new QCheckBox(_("Constellation Boundaries"), showGroup);
//actionColl->action("showBoundaries")->connect(showBoundariesCheck, SIGNAL(clicked()), SLOT(activate()));
showBoundariesCheck->setChecked(renderFlags & Renderer::ShowBoundaries);
@ -658,22 +658,22 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
int orbitMask = appCore->getRenderer()->getOrbitMask();
savedOrbitMask = orbitMask;
QGroupBox* labelGroup = new QGroupBox(0, Qt::Horizontal, tr("Orbits / Labels"));
QGroupBox* labelGroup = new QGroupBox(0, Qt::Horizontal, _("Orbits / Labels"));
vbox1Layout->addWidget(labelGroup);
QGridLayout* labelGroupLayout = new QGridLayout( labelGroup->layout() );
labelGroupLayout->setAlignment( Qt::AlignTop );
QLabel* orbitsLabel = new QLabel(tr("Orbits"), labelGroup);
QLabel* orbitsLabel = new QLabel(_("Orbits"), labelGroup);
labelGroupLayout->addWidget(orbitsLabel, 0, 0);
QLabel* labelsLabel = new QLabel(tr("Labels"), labelGroup);
QLabel* labelsLabel = new QLabel(_("Labels"), labelGroup);
labelGroupLayout->addWidget(labelsLabel, 0, 1);
#if 0
QCheckBox* showStarOrbitsCheck = new QCheckBox("", labelGroup);
//actionColl->action("showStarOrbits")->connect(showStarOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showStarOrbitsCheck->setChecked(orbitMask & Body::Stellar);
labelGroupLayout->addWidget(showStarOrbitsCheck, 1, 0, Qt::AlignHCenter);
QCheckBox* showStarLabelsCheck = new QCheckBox(tr("Stars"), labelGroup);
QCheckBox* showStarLabelsCheck = new QCheckBox(_("Stars"), labelGroup);
//actionColl->action("showStarLabels")->connect(showStarLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showStarLabelsCheck->setChecked(labelMode & Renderer::StarLabels);
labelGroupLayout->addWidget(showStarLabelsCheck, 1, 1);
@ -683,7 +683,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
//actionColl->action("showPlanetOrbits")->connect(showPlanetOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showPlanetOrbitsCheck->setChecked(orbitMask & Body::Planet);
labelGroupLayout->addWidget(showPlanetOrbitsCheck, 3, 0, Qt::AlignHCenter);
QCheckBox* showPlanetLabelsCheck = new QCheckBox(tr("Planets"), labelGroup);
QCheckBox* showPlanetLabelsCheck = new QCheckBox(_("Planets"), labelGroup);
//actionColl->action("showPlanetLabels")->connect(showPlanetLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showPlanetLabelsCheck->setChecked(labelMode & Renderer::PlanetLabels);
labelGroupLayout->addWidget(showPlanetLabelsCheck, 3, 1);
@ -692,7 +692,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
//actionColl->action("showMoonOrbits")->connect(showMoonOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showMoonOrbitsCheck->setChecked(orbitMask & Body::Moon);
labelGroupLayout->addWidget(showMoonOrbitsCheck, 4, 0, Qt::AlignHCenter);
QCheckBox* showMoonLabelsCheck = new QCheckBox(tr("Moons"), labelGroup);
QCheckBox* showMoonLabelsCheck = new QCheckBox(_("Moons"), labelGroup);
//actionColl->action("showMoonLabels")->connect(showMoonLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showMoonLabelsCheck->setChecked(labelMode & Renderer::MoonLabels);
labelGroupLayout->addWidget(showMoonLabelsCheck, 4, 1);
@ -701,32 +701,32 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
//actionColl->action("showCometOrbits")->connect(showCometOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showCometOrbitsCheck->setChecked(orbitMask & Body::Comet);
labelGroupLayout->addWidget(showCometOrbitsCheck, 5, 0, Qt::AlignHCenter);
QCheckBox* showCometLabelsCheck = new QCheckBox(tr("Comets"), labelGroup);
QCheckBox* showCometLabelsCheck = new QCheckBox(_("Comets"), labelGroup);
//actionColl->action("showCometLabels")->connect(showCometLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showCometLabelsCheck->setChecked(labelMode & Renderer::CometLabels);
labelGroupLayout->addWidget(showCometLabelsCheck, 5, 1);
QCheckBox* showConstellationLabelsCheck = new QCheckBox(tr("Constellations"), labelGroup);
QCheckBox* showConstellationLabelsCheck = new QCheckBox(_("Constellations"), labelGroup);
//actionColl->action("showConstellationLabels")->connect(showConstellationLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showConstellationLabelsCheck->setChecked(labelMode & Renderer::ConstellationLabels);
labelGroupLayout->addWidget(showConstellationLabelsCheck, 6, 1);
QCheckBox* showI18nConstellationLabelsCheck = new QCheckBox(tr("Constellations in Latin"), labelGroup);
QCheckBox* showI18nConstellationLabelsCheck = new QCheckBox(_("Constellations in Latin"), labelGroup);
//actionColl->action("showI18nConstellationLabels")->connect(showI18nConstellationLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showI18nConstellationLabelsCheck->setChecked(!(labelMode & Renderer::I18nConstellationLabels));
labelGroupLayout->addWidget(showI18nConstellationLabelsCheck, 7, 1);
QCheckBox* showGalaxyLabelsCheck = new QCheckBox(tr("Galaxies"), labelGroup);
QCheckBox* showGalaxyLabelsCheck = new QCheckBox(_("Galaxies"), labelGroup);
//actionColl->action("showGalaxyLabels")->connect(showGalaxyLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showGalaxyLabelsCheck->setChecked(labelMode & Renderer::GalaxyLabels);
labelGroupLayout->addWidget(showGalaxyLabelsCheck, 8, 1);
QCheckBox* showNebulaLabelsCheck = new QCheckBox(tr("Nebulae"), labelGroup);
QCheckBox* showNebulaLabelsCheck = new QCheckBox(_("Nebulae"), labelGroup);
//actionColl->action("showNebulaLabels")->connect(showNebulaLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showNebulaLabelsCheck->setChecked(labelMode & Renderer::NebulaLabels);
labelGroupLayout->addWidget(showNebulaLabelsCheck, 9, 1);
QCheckBox* showOpenClusterLabelsCheck = new QCheckBox(tr("Open Clusters"), labelGroup);
QCheckBox* showOpenClusterLabelsCheck = new QCheckBox(_("Open Clusters"), labelGroup);
//actionColl->action("showOpenClusterLabels")->connect(showOpenClusterLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showOpenClusterLabelsCheck->setChecked(labelMode & Renderer::OpenClusterLabels);
labelGroupLayout->addWidget(showOpenClusterLabelsCheck, 10, 1);
@ -735,7 +735,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
//actionColl->action("showAsteroidOrbits")->connect(showAsteroidOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showAsteroidOrbitsCheck->setChecked(orbitMask & Body::Asteroid);
labelGroupLayout->addWidget(showAsteroidOrbitsCheck, 11, 0, Qt::AlignHCenter);
QCheckBox* showAsteroidLabelsCheck = new QCheckBox(tr("Asteroids"), labelGroup);
QCheckBox* showAsteroidLabelsCheck = new QCheckBox(_("Asteroids"), labelGroup);
//actionColl->action("showAsteroidLabels")->connect(showAsteroidLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showAsteroidLabelsCheck->setChecked(labelMode & Renderer::AsteroidLabels);
labelGroupLayout->addWidget(showAsteroidLabelsCheck, 11, 1);
@ -744,12 +744,12 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
//actionColl->action("showSpacecraftOrbits")->connect(showSpacecraftOrbitsCheck, SIGNAL(clicked()), SLOT(activate()));
showSpacecraftOrbitsCheck->setChecked(orbitMask & Body::Spacecraft);
labelGroupLayout->addWidget(showSpacecraftOrbitsCheck, 12, 0, Qt::AlignHCenter);
QCheckBox* showSpacecraftLabelsCheck = new QCheckBox(tr("Spacecrafts"), labelGroup);
QCheckBox* showSpacecraftLabelsCheck = new QCheckBox(_("Spacecrafts"), labelGroup);
//actionColl->action("showSpacecraftLabels")->connect(showSpacecraftLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showSpacecraftLabelsCheck->setChecked(labelMode & Renderer::SpacecraftLabels);
labelGroupLayout->addWidget(showSpacecraftLabelsCheck, 12, 1);
QCheckBox* showLocationLabelsCheck = new QCheckBox(tr("Locations"), labelGroup);
QCheckBox* showLocationLabelsCheck = new QCheckBox(_("Locations"), labelGroup);
//actionColl->action("showLocationLabels")->connect(showLocationLabelsCheck, SIGNAL(clicked()), SLOT(activate()));
showLocationLabelsCheck->setChecked(labelMode & Renderer::LocationLabels);
labelGroupLayout->addWidget(showLocationLabelsCheck, 13, 1);
@ -758,7 +758,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
labelGroupLayout->addItem( spacer, 0, 2 );
savedAmbientLightLevel = int(appCore->getRenderer()->getAmbientLightLevel() * 100);
QGroupBox* ambientLightGroup = new QGroupBox(1, Qt::Vertical, tr("Ambient Light"), vbox1);
QGroupBox* ambientLightGroup = new QGroupBox(1, Qt::Vertical, _("Ambient Light"), vbox1);
QSlider* ambientLightSlider = new QSlider(0, 25, 1, savedAmbientLightLevel, Qt::Horizontal, ambientLightGroup);
connect(ambientLightSlider, SIGNAL(valueChanged(int)), SLOT(slotAmbientLightLevel(int)));
ambientLabel = new QLabel(ambientLightGroup);
@ -769,7 +769,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
ambientLabel->setText(buff);
savedFaintestVisible = int(appCore->getSimulation()->getFaintestVisible() * 100);
QGroupBox* faintestVisibleGroup = new QGroupBox(1, Qt::Vertical, tr("Limiting Magnitude"), vbox1);
QGroupBox* faintestVisibleGroup = new QGroupBox(1, Qt::Vertical, _("Limiting Magnitude"), vbox1);
QSlider* faintestVisibleSlider = new QSlider(1, 1200, 1, savedFaintestVisible, Qt::Horizontal, faintestVisibleGroup);
connect(faintestVisibleSlider, SIGNAL(valueChanged(int)), SLOT(slotFaintestVisible(int)));
faintestLabel = new QLabel(faintestVisibleGroup);
@ -778,20 +778,20 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
sprintf(buff, "%.2f", savedFaintestVisible / 100.);
faintestLabel->setText(buff);
QGroupBox* infoTextGroup = new QGroupBox(1, Qt::Vertical, tr("Info Text"), vbox1);
new QLabel(tr("Level: "), infoTextGroup);
QGroupBox* infoTextGroup = new QGroupBox(1, Qt::Vertical, _("Info Text"), vbox1);
new QLabel(_("Level: "), infoTextGroup);
QComboBox* infoTextCombo = new QComboBox(infoTextGroup);
infoTextCombo->insertItem(tr("None"));
infoTextCombo->insertItem(tr("Terse"));
infoTextCombo->insertItem(tr("Verbose"));
infoTextCombo->insertItem(_("None"));
infoTextCombo->insertItem(_("Terse"));
infoTextCombo->insertItem(_("Verbose"));
savedHudDetail = appCore->getHudDetail();
infoTextCombo->setCurrentItem(savedHudDetail);
((KdeApp*)parent)->connect(infoTextCombo, SIGNAL(activated(int)), SLOT(slotHudDetail(int)));
QGroupBox* fovGroup = new QGroupBox(2, Qt::Horizontal, tr("Automatic FOV"), vbox1);
new QLabel(tr("Screen DPI: "), fovGroup);
QGroupBox* fovGroup = new QGroupBox(2, Qt::Horizontal, _("Automatic FOV"), vbox1);
new QLabel(_("Screen DPI: "), fovGroup);
new QLabel(QString::number(appCore->getScreenDpi(), 10), fovGroup);
new QLabel(tr("Viewing Distance (cm): "), fovGroup);
new QLabel(_("Viewing Distance (cm): "), fovGroup);
dtsSpin = new QSpinBox(10, 300, 1, fovGroup);
savedDistanceToScreen = appCore->getDistanceToScreen();
dtsSpin->setValue(savedDistanceToScreen / 10);
@ -801,49 +801,49 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
Observer* obs = appCore->getSimulation()->getActiveObserver();
savedLocationFilter = obs->getLocationFilter();
QFrame* locationsFrame = addPage(tr("Locations"), tr("Locations"),
QFrame* locationsFrame = addPage(_("Locations"), _("Locations"),
KGlobal::iconLoader()->loadIcon("package_network", KIcon::NoGroup));
QVBoxLayout* locationsLayout = new QVBoxLayout( locationsFrame );
locationsLayout->setAutoAdd(TRUE);
locationsLayout->setAlignment(Qt::AlignTop);
QCheckBox* showCityLocationsCheck = new QCheckBox(tr("Cities"), locationsFrame);
QCheckBox* showCityLocationsCheck = new QCheckBox(_("Cities"), locationsFrame);
//actionColl->action("showCityLocations")->connect(showCityLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showCityLocationsCheck->setChecked(savedLocationFilter & Location::City);
QCheckBox* showObservatoryLocationsCheck = new QCheckBox(tr("Observatories"), locationsFrame);
QCheckBox* showObservatoryLocationsCheck = new QCheckBox(_("Observatories"), locationsFrame);
//actionColl->action("showObservatoryLocations")->connect(showObservatoryLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showObservatoryLocationsCheck->setChecked(savedLocationFilter & Location::Observatory);
QCheckBox* showLandingSiteLocationsCheck = new QCheckBox(tr("Landing Sites"), locationsFrame);
QCheckBox* showLandingSiteLocationsCheck = new QCheckBox(_("Landing Sites"), locationsFrame);
//actionColl->action("showLandingSiteLocations")->connect(showLandingSiteLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showLandingSiteLocationsCheck->setChecked(savedLocationFilter & Location::LandingSite);
QCheckBox* showCraterLocationsCheck = new QCheckBox(tr("Craters"), locationsFrame);
QCheckBox* showCraterLocationsCheck = new QCheckBox(_("Craters"), locationsFrame);
//actionColl->action("showCraterLocations")->connect(showCraterLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showCraterLocationsCheck->setChecked(savedLocationFilter & Location::Crater);
QCheckBox* showMonsLocationsCheck = new QCheckBox(tr("Mons"), locationsFrame);
QCheckBox* showMonsLocationsCheck = new QCheckBox(_("Mons"), locationsFrame);
//actionColl->action("showMonsLocations")->connect(showMonsLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showMonsLocationsCheck->setChecked(savedLocationFilter & Location::Mons);
QCheckBox* showTerraLocationsCheck = new QCheckBox(tr("Terra"), locationsFrame);
QCheckBox* showTerraLocationsCheck = new QCheckBox(_("Terra"), locationsFrame);
//actionColl->action("showTerraLocations")->connect(showTerraLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showTerraLocationsCheck->setChecked(savedLocationFilter & Location::Terra);
QCheckBox* showVallisLocationsCheck = new QCheckBox(tr("Vallis"), locationsFrame);
QCheckBox* showVallisLocationsCheck = new QCheckBox(_("Vallis"), locationsFrame);
//actionColl->action("showVallisLocations")->connect(showVallisLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showVallisLocationsCheck->setChecked(savedLocationFilter & Location::Vallis);
QCheckBox* showMareLocationsCheck = new QCheckBox(tr("Mare"), locationsFrame);
QCheckBox* showMareLocationsCheck = new QCheckBox(_("Mare"), locationsFrame);
//actionColl->action("showMareLocations")->connect(showMareLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showMareLocationsCheck->setChecked(savedLocationFilter & Location::Mare);
QCheckBox* showOtherLocationsCheck = new QCheckBox(tr("Other"), locationsFrame);
QCheckBox* showOtherLocationsCheck = new QCheckBox(_("Other"), locationsFrame);
//actionColl->action("showOtherLocations")->connect(showOtherLocationsCheck, SIGNAL(clicked()), SLOT(activate()));
showOtherLocationsCheck->setChecked(savedLocationFilter & FilterOtherLocations);
QGroupBox* minFeatureSizeGroup = new QGroupBox(1, Qt::Vertical, tr("Minimum Feature Size"), locationsFrame);
QGroupBox* minFeatureSizeGroup = new QGroupBox(1, Qt::Vertical, _("Minimum Feature Size"), locationsFrame);
minFeatureSizeGroup->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
savedMinFeatureSize = (int)appCore->getRenderer()->getMinimumFeatureSize();
QSlider* minFeatureSizeSlider = new QSlider(1, 1000, 1, savedMinFeatureSize, Qt::Horizontal, minFeatureSizeGroup);
@ -857,26 +857,26 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
// Time page
timeHasChanged = false;
QVBox* timeFrame = addVBoxPage(tr("Date/Time"), tr("Date/Time"),
QVBox* timeFrame = addVBoxPage(_("Date/Time"), _("Date/Time"),
KGlobal::iconLoader()->loadIcon("clock", KIcon::NoGroup));
savedDisplayLocalTime = appCore->getTimeZoneBias();
QGroupBox* displayTimezoneGroup = new QGroupBox(1, Qt::Vertical, tr("Display"), timeFrame);
new QLabel(tr("Timezone: "), displayTimezoneGroup);
QGroupBox* displayTimezoneGroup = new QGroupBox(1, Qt::Vertical, _("Display"), timeFrame);
new QLabel(_("Timezone: "), displayTimezoneGroup);
displayTimezoneCombo = new QComboBox(displayTimezoneGroup);
displayTimezoneCombo->insertItem(tr("UTC"));
displayTimezoneCombo->insertItem(tr("Local Time"));
displayTimezoneCombo->insertItem(_("UTC"));
displayTimezoneCombo->insertItem(_("Local Time"));
displayTimezoneCombo->setCurrentItem((appCore->getTimeZoneBias()==0)?0:1);
((KdeApp*)parent)->connect(displayTimezoneCombo, SIGNAL(activated(int)), SLOT(slotDisplayLocalTime()));
displayTimezoneGroup->addSpace(0);
QGroupBox* setTimezoneGroup = new QGroupBox(1, Qt::Horizontal, tr("Set"), timeFrame);
new QLabel(tr("Local Time is only supported for dates between 1902 and 2037.\n"), setTimezoneGroup);
QGroupBox* setTimezoneGroup = new QGroupBox(1, Qt::Horizontal, _("Set"), timeFrame);
new QLabel(_("Local Time is only supported for dates between 1902 and 2037.\n"), setTimezoneGroup);
QBox *hbox2 = new QBox(setTimezoneGroup);
new QLabel(tr("Timezone: "), hbox2);
new QLabel(_("Timezone: "), hbox2);
setTimezoneCombo = new QComboBox(hbox2);
setTimezoneCombo->insertItem(tr("UTC"));
setTimezoneCombo->insertItem(tr("Local Time"));
setTimezoneCombo->insertItem(_("UTC"));
setTimezoneCombo->insertItem(_("Local Time"));
// setTimezoneCombo->setCurrentItem((appCore->getTimeZoneBias()==0)?0:1);
KGlobal::config()->setGroup("ConfigureDialog");
if (KGlobal::config()->hasKey("SetTimeTimeZoneLocal"))
@ -924,7 +924,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
connect(sSpin, SIGNAL(valueChanged(int)), SLOT(slotTimeHasChanged()));
KPushButton *nowButton = new KPushButton(setTimezoneGroup);
nowButton->setText(tr("Now"));
nowButton->setText(_("Now"));
QSizePolicy nowButtonSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
nowButton->setSizePolicy(nowButtonSizePolicy);
connect(nowButton, SIGNAL(clicked()), SLOT(setNow()));
@ -945,46 +945,46 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
if (lt_h == 0) snprintf(time, 50, "%d min %02.1f s", lt_m, lt_s);
else snprintf(time, 50, "%ld h %02d min %02.1f s", lt_h, lt_m, lt_s);
new QLabel(tr("\nSelection: " + QString(sel_name.c_str())
new QLabel(_("\nSelection: " + QString(sel_name.c_str())
+ QString("\nLight Travel Time: %2").arg(time)), ltBox);
KPushButton *ltButton = new KPushButton(ltBox);
ltButton->setToggleButton(true);
if (!appCore->getLightDelayActive())
ltButton->setText(tr("Include Light Travel Time"));
ltButton->setText(_("Include Light Travel Time"));
else
ltButton->setText(tr("Ignore Light Travel Time "));
ltButton->setText(_("Ignore Light Travel Time "));
ltButton->setSizePolicy(nowButtonSizePolicy);
connect(ltButton, SIGNAL(clicked()), SLOT(ltSubstract()));
}
// OpenGL Page
QVBox* openGL = addVBoxPage(tr("OpenGL"), tr("OpenGL"),
QVBox* openGL = addVBoxPage(_("OpenGL"), _("OpenGL"),
KGlobal::iconLoader()->loadIcon("misc", KIcon::NoGroup));
renderPathCombo = new QComboBox(openGL);
savedRenderPath = (int)appCore->getRenderer()->getGLContext()->getRenderPath();
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_Basic))
renderPathCombo->insertItem(tr("Basic"));
renderPathCombo->insertItem(_("Basic"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_Multitexture))
renderPathCombo->insertItem(tr("Multitexture"));
renderPathCombo->insertItem(_("Multitexture"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_NvCombiner))
renderPathCombo->insertItem(tr("NvCombiners"));
renderPathCombo->insertItem(_("NvCombiners"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_DOT3_ARBVP))
renderPathCombo->insertItem(tr("DOT3 ARBVP"));
renderPathCombo->insertItem(_("DOT3 ARBVP"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_NvCombiner_NvVP))
renderPathCombo->insertItem(tr("NvCombiner NvVP"));
renderPathCombo->insertItem(_("NvCombiner NvVP"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_NvCombiner_ARBVP))
renderPathCombo->insertItem(tr("NvCombiner ARBVP"));
renderPathCombo->insertItem(_("NvCombiner ARBVP"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_ARBFP_ARBVP))
renderPathCombo->insertItem(tr("ARBFP ARBVP"));
renderPathCombo->insertItem(_("ARBFP ARBVP"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_NV30))
renderPathCombo->insertItem(tr("NV30"));
renderPathCombo->insertItem(_("NV30"));
if (appCore->getRenderer()->getGLContext()->renderPathSupported(GLContext::GLPath_GLSL))
renderPathCombo->insertItem(tr("OpenGL 2.0"));
renderPathCombo->insertItem(_("OpenGL 2.0"));
connect(renderPathCombo, SIGNAL(activated(int)), SLOT(slotRenderPath(int)));
@ -1003,7 +1003,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
renderPathLabel->setTextFormat(Qt::RichText);
setRenderPathLabel();
QCheckBox* videoSyncCheck = new QCheckBox(tr("Sync framerate to video refresh rate"), openGL);
QCheckBox* videoSyncCheck = new QCheckBox(_("Sync framerate to video refresh rate"), openGL);
//actionColl->action("toggleVideoSync")->connect(videoSyncCheck, SIGNAL(clicked()), SLOT(activate()));
savedVideoSync = appCore->getRenderer()->getVideoSync();
videoSyncCheck->setChecked(savedVideoSync);
@ -1016,7 +1016,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, CelestiaCore* core) :
// Key bindings page
QVBox* keyBindings = addVBoxPage(tr("Key Bindings"), tr("Key Bindings"),
QVBox* keyBindings = addVBoxPage(_("Key Bindings"), _("Key Bindings"),
KGlobal::iconLoader()->loadIcon("key_bindings", KIcon::NoGroup));
//keyChooser = new KKeyChooser(((KMainWindow*)parent)->actionCollection(), keyBindings, false);
@ -1232,35 +1232,35 @@ void PreferencesDialog::slotDistanceToScreen(int dts) {
void PreferencesDialog::setRenderPathLabel() {
switch(appCore->getRenderer()->getGLContext()->getRenderPath()) {
case GLContext::GLPath_Basic:
renderPathLabel->setText(tr("<b>Unextended OpenGL 1.1</b>"));
renderPathLabel->setText(_("<b>Unextended OpenGL 1.1</b>"));
break;
case GLContext::GLPath_Multitexture:
renderPathLabel->setText(tr("<b>Multiple textures and the ARB_texenv_combine extension</b>"));
renderPathLabel->setText(_("<b>Multiple textures and the ARB_texenv_combine extension</b>"));
break;
case GLContext::GLPath_NvCombiner:
renderPathLabel->setText(tr("<b>NVIDIA combiners, no vertex programs</b>"));
renderPathLabel->setText(_("<b>NVIDIA combiners, no vertex programs</b>"));
break;
case GLContext::GLPath_DOT3_ARBVP:
renderPathLabel->setText(tr("<b>ARB_texenv_DOT3 extension, ARB_vertex_program extension</b>"));
renderPathLabel->setText(_("<b>ARB_texenv_DOT3 extension, ARB_vertex_program extension</b>"));
break;
case GLContext::GLPath_NvCombiner_NvVP:
renderPathLabel->setText(tr("<b>NVIDIA Combiners, NV_vertex_program extension</b><br> "
renderPathLabel->setText(_("<b>NVIDIA Combiners, NV_vertex_program extension</b><br> "
"provide bump mapping, ring shadows, and specular "
"highlights on any Geforce or ATI Radeon graphics card, though "
"NvCombiner ARBVP is a slightly better option for Geforce users"));
break;
case GLContext::GLPath_NvCombiner_ARBVP:
renderPathLabel->setText(tr("<b>NVIDIA Combiners, ARB_vertex_program extension</b>"));
renderPathLabel->setText(_("<b>NVIDIA Combiners, ARB_vertex_program extension</b>"));
break;
case GLContext::GLPath_ARBFP_ARBVP:
renderPathLabel->setText(tr("<b>ARB_fragment_program and ARB_vertex_program extensions</b><br>"
renderPathLabel->setText(_("<b>ARB_fragment_program and ARB_vertex_program extensions</b><br>"
"provide advanced effects on Geforce FX and Radeon 9700 cards"));
break;
case GLContext::GLPath_NV30:
renderPathLabel->setText(tr("<b>NV_fragment_program and ARB_vertex_program extensions</b>"));
renderPathLabel->setText(_("<b>NV_fragment_program and ARB_vertex_program extensions</b>"));
break;
case GLContext::GLPath_GLSL:
renderPathLabel->setText(tr("<b>OpenGL 2.0 Shading Language</b>"));
renderPathLabel->setText(_("<b>OpenGL 2.0 Shading Language</b>"));
break;
}
}

View File

@ -93,8 +93,8 @@ SelectionPopup::SelectionPopup(const Selection& sel,
}
else if (sel.star() != NULL)
{
std::string name = sim->getUniverse()->getStarCatalog()->getStarName(*sel.star());
addAction(boldTextItem(QString::fromUtf8(ReplaceGreekLetterAbbr(name).c_str())));
std::string name = ReplaceGreekLetterAbbr(sim->getUniverse()->getStarCatalog()->getStarName(*sel.star(), true));
addAction(boldTextItem(QString::fromUtf8(name.c_str())));
// Add some text items giving additional information about
// the star.
@ -112,45 +112,45 @@ SelectionPopup::SelectionPopup(const Selection& sel,
else
sprintf(buff, "%.3f m", astro::lightYearsToKilometers(distance) * 1000.0f);
addAction(italicTextItem(tr("Distance: ") + QString::fromUtf8(buff)));
addAction(italicTextItem(_("Distance: ") + QString::fromUtf8(buff)));
sprintf(buff, "%.2f (%.2f)",
sel.star()->getAbsoluteMagnitude(),
astro::absToAppMag(sel.star()->getAbsoluteMagnitude(),
(float) distance));
addAction(italicTextItem(tr("Abs (app) mag: ") + QString::fromUtf8(buff)));
addAction(italicTextItem(_("Abs (app) mag: ") + QString::fromUtf8(buff)));
sprintf(buff, "%s", sel.star()->getSpectralType());
addAction(italicTextItem(tr("Class: ") + QString::fromUtf8(buff)));
addAction(italicTextItem(_("Class: ") + QString::fromUtf8(buff)));
setlocale(LC_NUMERIC, "C");
}
else if (sel.deepsky() != NULL)
{
addAction(boldTextItem(QString::fromUtf8(sim->getUniverse()->getDSOCatalog()->getDSOName(sel.deepsky()).c_str())));
addAction(boldTextItem(QString::fromUtf8(sim->getUniverse()->getDSOCatalog()->getDSOName(sel.deepsky(), true).c_str())));
}
addSeparator();
QAction* selectAction = new QAction(tr("&Select"), this);
QAction* selectAction = new QAction(_("&Select"), this);
connect(selectAction, SIGNAL(triggered()), this, SLOT(slotSelect()));
addAction(selectAction);
centerAction = new QAction(tr("&Center"), this);
centerAction = new QAction(_("&Center"), this);
connect(centerAction, SIGNAL(triggered()), this, SLOT(slotCenterSelection()));
addAction(centerAction);
gotoAction = new QAction(tr("&Goto"), this);
gotoAction = new QAction(_("&Goto"), this);
connect(gotoAction, SIGNAL(triggered()), this, SLOT(slotGotoSelection()));
addAction(gotoAction);
QAction* followAction = new QAction(tr("&Follow"), this);
QAction* followAction = new QAction(_("&Follow"), this);
connect(followAction, SIGNAL(triggered()), this, SLOT(slotFollowSelection()));
addAction(followAction);
if (sel.star() == NULL && sel.deepsky() == NULL)
{
QAction* syncOrbitAction = new QAction(tr("S&ynch Orbit"), this);
QAction* syncOrbitAction = new QAction(_("S&ynch Orbit"), this);
connect(syncOrbitAction, SIGNAL(triggered()), this, SLOT(slotSyncOrbitSelection()));
addAction(syncOrbitAction);
}
@ -233,24 +233,24 @@ QMenu* SelectionPopup::createMarkMenu()
};
const char* MARKER_NAMES[] = {
"Diamond",
"Triangle",
"Square",
"Filled Square",
"Plus",
"X",
"Left Arrow",
"Right Arrow",
"Up Arrow",
"Down Arrow",
"Circle",
"Disk",
gettext_noop("Diamond"),
gettext_noop("Triangle"),
gettext_noop("Square"),
gettext_noop("Filled Square"),
gettext_noop("Plus"),
gettext_noop("X"),
gettext_noop("Left Arrow"),
gettext_noop("Right Arrow"),
gettext_noop("Up Arrow"),
gettext_noop("Down Arrow"),
gettext_noop("Circle"),
gettext_noop("Disk"),
};
QMenu* markMenu = new QMenu("&Mark");
QMenu* markMenu = new QMenu(_("&Mark"));
for (int i = 0; i < (int) (sizeof(MARKER_NAMES) / sizeof(MARKER_NAMES[0])); i++)
{
QAction* act = new QAction(tr(MARKER_NAMES[i]), markMenu);
QAction* act = new QAction(_(MARKER_NAMES[i]), markMenu);
act->setData((int) MARKER_SYMBOLS[i]);
connect(act, SIGNAL(triggered()), this, SLOT(slotMark()));
markMenu->addAction(act);
@ -265,33 +265,33 @@ QMenu* SelectionPopup::createReferenceVectorMenu()
assert(selection.body() != NULL);
Body* body = selection.body();
QMenu* refVecMenu = new QMenu(tr("&Reference Marks"));
QMenu* refVecMenu = new QMenu(_("&Reference Marks"));
QAction* bodyAxesAction = new QAction(tr("Show &Body Axes"), refVecMenu);
QAction* bodyAxesAction = new QAction(_("Show &Body Axes"), refVecMenu);
bodyAxesAction->setCheckable(true);
bodyAxesAction->setChecked(appCore->referenceMarkEnabled("body axes", selection));
connect(bodyAxesAction, SIGNAL(triggered()), this, SLOT(slotToggleBodyAxes()));
refVecMenu->addAction(bodyAxesAction);
QAction* frameAxesAction = new QAction(tr("Show &Frame Axes"), refVecMenu);
QAction* frameAxesAction = new QAction(_("Show &Frame Axes"), refVecMenu);
frameAxesAction->setCheckable(true);
frameAxesAction->setChecked(appCore->referenceMarkEnabled("frame axes", selection));
connect(frameAxesAction, SIGNAL(triggered()), this, SLOT(slotToggleFrameAxes()));
refVecMenu->addAction(frameAxesAction);
QAction* sunDirectionAction = new QAction(tr("Show &Sun Direction"), refVecMenu);
QAction* sunDirectionAction = new QAction(_("Show &Sun Direction"), refVecMenu);
sunDirectionAction->setCheckable(true);
sunDirectionAction->setChecked(appCore->referenceMarkEnabled("sun direction", selection));
connect(sunDirectionAction, SIGNAL(triggered()), this, SLOT(slotToggleSunDirection()));
refVecMenu->addAction(sunDirectionAction);
QAction* velocityVectorAction = new QAction(tr("Show &Velocity Vector"), refVecMenu);
QAction* velocityVectorAction = new QAction(_("Show &Velocity Vector"), refVecMenu);
velocityVectorAction->setCheckable(true);
velocityVectorAction->setChecked(appCore->referenceMarkEnabled("velocity vector", selection));
connect(velocityVectorAction, SIGNAL(triggered()), this, SLOT(slotToggleVelocityVector()));
refVecMenu->addAction(velocityVectorAction);
QAction* spinVectorAction = new QAction(tr("Show S&pin Vector"), refVecMenu);
QAction* spinVectorAction = new QAction(_("Show S&pin Vector"), refVecMenu);
spinVectorAction->setCheckable(true);
spinVectorAction->setChecked(appCore->referenceMarkEnabled("spin vector", selection));
connect(spinVectorAction, SIGNAL(triggered()), this, SLOT(slotToggleSpinVector()));
@ -303,20 +303,20 @@ QMenu* SelectionPopup::createReferenceVectorMenu()
// Only show the frame center menu item if the selection orbits another
// a non-stellar object. If it orbits a star, this is generally identical
// to the sun direction entry.
QAction* frameCenterAction = new QAction(tr("Show &Direction to %1").arg(center.body()->getName(true).c_str()), refVecMenu);
QAction* frameCenterAction = new QAction(QString(_("Show &Direction to %1")).arg(QString::fromUtf8(center.body()->getName(true).c_str())), refVecMenu);
frameCenterAction->setCheckable(true);
frameCenterAction->setChecked(appCore->referenceMarkEnabled("frame center direction", selection));
connect(frameCenterAction, SIGNAL(triggered()), this, SLOT(slotToggleFrameCenterDirection()));
refVecMenu->addAction(frameCenterAction);
}
QAction* gridAction = new QAction(tr("Show Planetographic &Grid"), refVecMenu);
QAction* gridAction = new QAction(_("Show Planetographic &Grid"), refVecMenu);
gridAction->setCheckable(true);
gridAction->setChecked(appCore->referenceMarkEnabled("planetographic grid", selection));
connect(gridAction, SIGNAL(triggered()), this, SLOT(slotTogglePlanetographicGrid()));
refVecMenu->addAction(gridAction);
QAction* terminatorAction = new QAction(tr("Show &Terminator"), refVecMenu);
QAction* terminatorAction = new QAction(_("Show &Terminator"), refVecMenu);
terminatorAction->setCheckable(true);
terminatorAction->setChecked(appCore->referenceMarkEnabled("terminator", selection));
connect(terminatorAction, SIGNAL(triggered()), this, SLOT(slotToggleTerminator()));
@ -334,8 +334,8 @@ QMenu* SelectionPopup::createAlternateSurfacesMenu()
{
if (!altSurfaces->empty())
{
surfacesMenu = new QMenu(tr("&Alternate Surfaces"), this);
QAction* normalAct = new QAction(tr("Normal"), surfacesMenu);
surfacesMenu = new QMenu(_("&Alternate Surfaces"), this);
QAction* normalAct = new QAction(_("Normal"), surfacesMenu);
normalAct->setData(QString(""));
surfacesMenu->addAction(normalAct);
connect(normalAct, SIGNAL(triggered()), this, SLOT(slotSelectAlternateSurface()));
@ -379,28 +379,28 @@ QMenu* SelectionPopup::createObjectMenu(PlanetarySystem* sys,
switch (classification)
{
case Body::Planet:
title = tr("Planets");
title = _("Planets");
break;
case Body::Moon:
title = tr("Moons");
title = _("Moons");
break;
case Body::Asteroid:
title = tr("Asteroids");
title = _("Asteroids");
break;
case Body::Comet:
title = tr("Comets");
title = _("Comets");
break;
case Body::Spacecraft:
title = tr("Spacecraft");
title = _("Spacecraft");
break;
default:
title = tr("Other objects");
title = _("Other objects");
break;
}
menu = new QMenu(title, this);
}
QAction* act = new QAction(QString(body->getName().c_str()), menu);
QAction* act = new QAction(QString::fromUtf8(body->getName(true).c_str()), menu);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(slotSelectChildObject()));
menu->addAction(act);

View File

@ -49,22 +49,22 @@ SetTimeDialog::SetTimeDialog(double currentTimeTDB,
QGridLayout* timeLayout = new QGridLayout();
QLabel* timeZoneLabel = new QLabel(tr("Time Zone: "));
QLabel* timeZoneLabel = new QLabel(_("Time Zone: "));
timeLayout->addWidget(timeZoneLabel, 0, 0);
timeZoneBox = new QComboBox(this);
timeZoneBox->setEditable(false);
timeZoneBox->addItem(tr("Universal Time"), 0);
timeZoneBox->addItem(tr("Local Time"), 1);
timeZoneBox->addItem(_("Universal Time"), 0);
timeZoneBox->addItem(_("Local Time"), 1);
bool useLocalTime = appCore->getTimeZoneBias() != 0;
timeZoneBox->setCurrentIndex(useLocalTime ? 1 : 0);
timeZoneBox->setToolTip(tr("Select Time Zone"));
timeZoneBox->setToolTip(_("Select Time Zone"));
timeLayout->addWidget(timeZoneBox, 0, 1, 1, 5);
connect(timeZoneBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(slotTimeZoneChanged()));
QLabel* dateLabel = new QLabel(tr("Date: "));
QLabel* dateLabel = new QLabel(_("Date: "));
timeLayout->addWidget(dateLabel, 1, 0);
yearSpin = new QSpinBox(this);
@ -82,17 +82,17 @@ SetTimeDialog::SetTimeDialog(double currentTimeTDB,
monthSpin->setValue(date.month);
daySpin->setValue(date.day);
yearSpin->setToolTip(tr("Set Year"));
yearSpin->setToolTip(_("Set Year"));
timeLayout->addWidget(yearSpin, 1, 1);
connect(yearSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
monthSpin->setToolTip(tr("Set Month"));
monthSpin->setToolTip(_("Set Month"));
timeLayout->addWidget(monthSpin, 1, 3);
connect(monthSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
daySpin->setToolTip(tr("Set Day"));
daySpin->setToolTip(_("Set Day"));
timeLayout->addWidget(daySpin, 1, 5);
connect(daySpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
QLabel* timeLabel = new QLabel(tr("Time: "));
QLabel* timeLabel = new QLabel(_("Time: "));
timeLayout->addWidget(timeLabel, 2, 0);
hourSpin = new QSpinBox(this);
@ -111,19 +111,19 @@ SetTimeDialog::SetTimeDialog(double currentTimeTDB,
minSpin->setValue(date.minute);
secSpin->setValue((int)date.seconds);
hourSpin->setToolTip(tr("Set Hours"));
hourSpin->setToolTip(_("Set Hours"));
timeLayout->addWidget(hourSpin, 2, 1);
connect(hourSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
timeLayout->addWidget(new QLabel(tr(":")), 2, 2);
minSpin->setToolTip(tr("Set Minutes"));
timeLayout->addWidget(new QLabel(_(":")), 2, 2);
minSpin->setToolTip(_("Set Minutes"));
timeLayout->addWidget(minSpin, 2, 3);
connect(minSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
timeLayout->addWidget(new QLabel(tr(":")), 2, 4);
secSpin->setToolTip(tr("Set Seconds"));
timeLayout->addWidget(new QLabel(_(":")), 2, 4);
secSpin->setToolTip(_("Set Seconds"));
timeLayout->addWidget(secSpin, 2, 5);
connect(secSpin, SIGNAL(valueChanged(int)), this, SLOT(slotDateTimeChanged()));
QLabel* julianDateLabel = new QLabel(tr("Julian Date: "));
QLabel* julianDateLabel = new QLabel(_("Julian Date: "));
timeLayout->addWidget(julianDateLabel, 3, 0);
julianDateSpin = new QDoubleSpinBox(this);
@ -135,7 +135,7 @@ SetTimeDialog::SetTimeDialog(double currentTimeTDB,
double jdUTC = astro::TAItoJDUTC(astro::TTtoTAI(astro::TDBtoTT(currentTimeTDB)));
julianDateSpin->setValue(jdUTC);
julianDateSpin->setToolTip(tr("Set Julian Date"));
julianDateSpin->setToolTip(_("Set Julian Date"));
timeLayout->addWidget(julianDateSpin, 3, 1, 1, 5);
connect(julianDateSpin, SIGNAL(valueChanged(double)), this, SLOT(slotSetDateTime()));
@ -144,11 +144,11 @@ SetTimeDialog::SetTimeDialog(double currentTimeTDB,
QDialogButtonBox* buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QPushButton* setTimeButton = new QPushButton(tr("Set time"), buttonBox);
QPushButton* setTimeButton = new QPushButton(_("Set time"), buttonBox);
buttonBox->addButton(setTimeButton, QDialogButtonBox::ApplyRole);
connect(setTimeButton, SIGNAL(clicked()), this, SLOT(slotSetSimulationTime()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
layout->addWidget(buttonBox);
@ -250,8 +250,9 @@ void SetTimeDialog::slotTimeZoneChanged()
}
void SetTimeDialog::slotOk()
void SetTimeDialog::accept()
{
slotSetSimulationTime();
accept();
QDialog::accept();
}

View File

@ -38,7 +38,7 @@ Q_OBJECT
void slotSetDateTime();
void slotDateTimeChanged();
void slotTimeZoneChanged();
void slotOk();
void accept();
signals:
void setTimeTriggered(double tdb);

View File

@ -504,57 +504,57 @@ static QString objectTypeName(const Selection& sel)
if (sel.star() != NULL)
{
if (!sel.star()->getVisibility())
return QObject::tr("Barycenter");
return _("Barycenter");
else
return QObject::tr("Star");
return _("Star");
}
else if (sel.body() != NULL)
{
int classification = sel.body()->getClassification();
if (classification == Body::Planet)
return QObject::tr("Planet");
return _("Planet");
else if (classification == Body::DwarfPlanet)
return QObject::tr("Dwarf planet");
return _("Dwarf planet");
else if (classification == Body::Moon || classification == Body::MinorMoon)
return QObject::tr("Moon");
return _("Moon");
else if (classification == Body::Asteroid)
return QObject::tr("Asteroid");
return _("Asteroid");
else if (classification == Body::Comet)
return QObject::tr("Comet");
return _("Comet");
else if (classification == Body::Spacecraft)
return QObject::tr("Spacecraft");
return _("Spacecraft");
else if (classification == Body::Invisible)
return QObject::tr("Reference point");
return _("Reference point");
else if (classification == Body::Component)
return QObject::tr("Component");
return _("Component");
else if (classification == Body::SurfaceFeature)
return QObject::tr("Surface feature");
return _("Surface feature");
}
return QObject::tr("Unknown");
return _("Unknown");
}
static QString classificationName(int classification)
{
if (classification == Body::Planet)
return QObject::tr("Planets");
return _("Planets");
else if (classification == Body::Moon)
return QObject::tr("Moons");
return _("Moons");
else if (classification == Body::Spacecraft)
return QObject::tr("Spacecraft");
return _("Spacecraft");
else if (classification == Body::Asteroid)
return QObject::tr("Asteroids & comets");
return _("Asteroids & comets");
else if (classification == Body::Invisible)
return QObject::tr("Reference points");
return _("Reference points");
else if (classification == Body::MinorMoon)
return QObject::tr("Minor moons");
return _("Minor moons");
else if (classification == Body::Component)
return QObject::tr("Components");
return _("Components");
else if (classification == Body::SurfaceFeature)
return QObject::tr("Surface features");
return _("Surface features");
else
return QObject::tr("Other objects");
return _("Other objects");
}
@ -584,12 +584,12 @@ QVariant SolarSystemTreeModel::data(const QModelIndex& index, int role) const
case NameColumn:
if (sel.star() != NULL)
{
string starNameString = ReplaceGreekLetterAbbr(universe->getStarCatalog()->getStarName(*sel.star()));
string starNameString = ReplaceGreekLetterAbbr(universe->getStarCatalog()->getStarName(*sel.star(), true));
return QString::fromUtf8(starNameString.c_str());
}
else if (sel.body() != NULL)
{
return QVariant(sel.body()->getName().c_str());
return QVariant(QString::fromUtf8((sel.body()->getName(true).c_str())));
}
else
{
@ -614,9 +614,9 @@ QVariant SolarSystemTreeModel::headerData(int section, Qt::Orientation /* orient
switch (section)
{
case 0:
return tr("Name");
return _("Name");
case 1:
return tr("Type");
return _("Type");
default:
return QVariant();
}
@ -671,11 +671,11 @@ SolarSystemBrowser::SolarSystemBrowser(CelestiaCore* _appCore, QWidget* parent)
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(treeView);
QPushButton* refreshButton = new QPushButton(tr("Refresh"));
QPushButton* refreshButton = new QPushButton(_("Refresh"));
connect(refreshButton, SIGNAL(clicked()), this, SLOT(slotRefreshTree()));
layout->addWidget(refreshButton);
groupCheckBox = new QCheckBox(tr("Group objects by class"));
groupCheckBox = new QCheckBox(_("Group objects by class"));
connect(groupCheckBox, SIGNAL(clicked()), this, SLOT(slotRefreshTree()));
layout->addWidget(groupCheckBox);

View File

@ -27,36 +27,36 @@ TimeToolBar::TimeToolBar(CelestiaCore* _appCore,
// Text-only buttons
setToolButtonStyle(Qt::ToolButtonTextOnly);
QAction* reverseTimeAction = new QAction(QString("< >"), this);
reverseTimeAction->setToolTip(tr("Reverse time"));
reverseTimeAction->setToolTip(_("Reverse time"));
QAction* slowTimeAction = new QAction(QString("<<|"), this);
slowTimeAction->setToolTip(tr("10x slower"));
slowTimeAction->setToolTip(_("10x slower"));
QAction* halfTimeAction = new QAction(QString("<|"), this);
halfTimeAction->setToolTip(tr("2x slower"));
halfTimeAction->setToolTip(_("2x slower"));
QAction* pauseAction = new QAction(QString("||"), this);
pauseAction->setToolTip(tr("Pause time"));
pauseAction->setToolTip(_("Pause time"));
QAction* realTimeAction = new QAction(QString(">"), this);
realTimeAction->setToolTip(tr("Real time"));
realTimeAction->setToolTip(_("Real time"));
QAction* doubleTimeAction = new QAction(QString(">>"), this);
doubleTimeAction->setToolTip(tr("2x faster"));
doubleTimeAction->setToolTip(_("2x faster"));
QAction* fastTimeAction = new QAction(QString(">>>"), this);
fastTimeAction->setToolTip(tr("10x faster"));
fastTimeAction->setToolTip(_("10x faster"));
#else
QAction* reverseTimeAction = new QAction(QIcon(":/icons/time-reverse.png"),
tr("Reverse time"), this);
_("Reverse time"), this);
QAction* slowTimeAction = new QAction(QIcon(":/icons/time-slower.png"),
tr("10x slower"), this);
_("10x slower"), this);
QAction* halfTimeAction = new QAction(QIcon(":/icons/time-half.png"),
tr("2x slower"), this);
_("2x slower"), this);
QAction* pauseAction = new QAction(QIcon(":/icons/time-pause.png"),
tr("Pause time"), this);
_("Pause time"), this);
QAction* realTimeAction = new QAction(QIcon(":/icons/time-realtime.png"),
tr("Real time"), this);
_("Real time"), this);
QAction* doubleTimeAction = new QAction(QIcon(":/icons/time-double.png"),
tr("2x faster"), this);
_("2x faster"), this);
QAction* fastTimeAction = new QAction(QIcon(":/icons/time-faster.png"),
tr("10x faster"), this);
_("10x faster"), this);
QAction* currentTimeAction = new QAction(QIcon(":icons/time-currenttime.png"),
tr("Set to current time"), this);
_("Set to current time"), this);
#endif
connect(reverseTimeAction, SIGNAL(triggered()), this, SLOT(slotReverseTime()));
addAction(reverseTimeAction);

View File

@ -60,7 +60,7 @@ XbelReader::read()
if (name() == "xbel" && (version == "1.0" || version.isEmpty()))
readXbel(rootItem);
else
raiseError(QObject::tr("Not an XBEL version 1.0 file."));
raiseError(QString(_("Not an XBEL version 1.0 file.")));
}
}

View File

@ -1610,7 +1610,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
AppendMenu(hMenu, MF_STRING, ID_NAVIGATION_SYNCORBIT, UTF8ToCurrentCP(_("S&ync Orbit")).c_str());
AppendMenu(hMenu, MF_STRING, ID_INFO, UTF8ToCurrentCP(_("&Info")).c_str());
HMENU refVectorMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) refVectorMenu, UTF8ToCurrentCP(_("&Reference Vectors")).c_str());
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) refVectorMenu, UTF8ToCurrentCP(_("&Reference Marks")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_BODY_AXES, UTF8ToCurrentCP(_("Show Body Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_FRAME_AXES, UTF8ToCurrentCP(_("Show Frame Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_SUN_DIRECTION, UTF8ToCurrentCP(_("Show Sun Direction")).c_str());

View File

@ -23,6 +23,7 @@
// gettext / libintl setup
#define _(string) gettext (string)
#define gettext_noop(string) string
#ifdef _WIN32