diff --git a/gui_qt/baseform.cpp b/gui_qt/baseform.cpp index 20b1597..90e5504 100644 --- a/gui_qt/baseform.cpp +++ b/gui_qt/baseform.cpp @@ -30,17 +30,17 @@ BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget hwidget = new QWidget(this); hwidget->setLayout(new QHBoxLayout()); - hwidget->layout()->addWidget(new QLabel("Layers : ", hwidget)); + hwidget->layout()->addWidget(new QLabel(tr("Layers : "), hwidget)); layer_list = new QComboBox(hwidget); hwidget->layout()->addWidget(layer_list); QObject::connect(layer_list, SIGNAL(currentIndexChanged(int)), this, SLOT(layerListChanged())); - layer_new = new QPushButton("Add layer", hwidget); + layer_new = new QPushButton(tr("Add layer"), hwidget); hwidget->layout()->addWidget(layer_new); QObject::connect(layer_new, SIGNAL(clicked()), this, SLOT(layerAddClicked())); - layer_del = new QPushButton("Delete layer", hwidget); + layer_del = new QPushButton(tr("Delete layer"), hwidget); hwidget->layout()->addWidget(layer_del); QObject::connect(layer_del, SIGNAL(clicked()), this, SLOT(layerDelClicked())); @@ -70,10 +70,10 @@ BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget this->setLayout(vlayout); this->setObjectName("_base_form_"); - button_apply = addButton("Apply"); + button_apply = addButton(tr("Apply")); button_apply->setEnabled(false); connect(button_apply, SIGNAL(clicked()), this, SLOT(applyConfig())); - button_revert = addButton("Revert"); + button_revert = addButton(tr("Revert")); button_revert->setEnabled(false); connect(button_revert, SIGNAL(clicked()), this, SLOT(revertConfig())); @@ -236,7 +236,7 @@ void BaseForm::setLayerCount(int layer_count) for (i = 0; i < layer_count; i++) { - layer_list->addItem(QString("Layer %1").arg(i + 1)); + layer_list->addItem(QString(tr("Layer %1")).arg(i + 1)); } if (selected >= 0) { diff --git a/gui_qt/dialogcolorgradation.cpp b/gui_qt/dialogcolorgradation.cpp index 09d1e07..624b5d0 100644 --- a/gui_qt/dialogcolorgradation.cpp +++ b/gui_qt/dialogcolorgradation.cpp @@ -48,18 +48,18 @@ public: QPushButton* button; _gradation = gradation; - addPreview(new PreviewColorGradation(this, _gradation), "Preview"); + addPreview(new PreviewColorGradation(this, _gradation), tr("Preview")); - addInputDouble("Position", &_layer.start, 0.0, 1.0, 0.01, 0.1); - addInputColor("Color", &_layer.col); + addInputDouble(tr("Position"), &_layer.start, 0.0, 1.0, 0.01, 0.1); + addInputColor(tr("Color"), &_layer.col); - button = addButton("Validate"); + button = addButton(tr("Validate")); QObject::connect(button, SIGNAL(clicked()), parent, SLOT(accept())); - button = addButton("Revert"); + button = addButton(tr("Revert")); QObject::connect(button, SIGNAL(clicked()), parent, SLOT(revert())); - button = addButton("Cancel"); + button = addButton(tr("Cancel")); QObject::connect(button, SIGNAL(clicked()), parent, SLOT(reject())); revertConfig(); @@ -126,7 +126,7 @@ DialogColorGradation::DialogColorGradation(QWidget *parent, ColorGradation* grad QObject::connect(button, SIGNAL(clicked()), this, SLOT(revert())); QObject::connect(button, SIGNAL(clicked()), this, SLOT(reject()));*/ - setWindowTitle("Paysages 3D - Color gradation editor"); + setWindowTitle(tr("Paysages 3D - Color gradation editor")); revert(); } diff --git a/gui_qt/dialognoise.cpp b/gui_qt/dialognoise.cpp index f899d29..2b64090 100644 --- a/gui_qt/dialognoise.cpp +++ b/gui_qt/dialognoise.cpp @@ -95,12 +95,12 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): layout()->addWidget(previews); previewLevel = new PreviewLevel(previews, _current); - previews->layout()->addWidget(new QLabel("Level preview")); + previews->layout()->addWidget(new QLabel(tr("Level preview"))); previews->layout()->addWidget(previewLevel); previewLevel->setScaling(1.0 / 127.0); previewLevel->start(); previewTotal = new PreviewTotal(previews, _current); - previews->layout()->addWidget(new QLabel("Total preview")); + previews->layout()->addWidget(new QLabel(tr("Total preview"))); previews->layout()->addWidget(previewTotal); previewTotal->setScaling(1.0 / 127.0); previewTotal->start(); @@ -109,7 +109,7 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): form->setLayout(new QVBoxLayout()); layout()->addWidget(form); - form->layout()->addWidget(new QLabel("Noise components")); + form->layout()->addWidget(new QLabel(tr("Noise components"))); levels = new QListWidget(form); form->layout()->addWidget(levels); QObject::connect(levels, SIGNAL(currentRowChanged(int)), this, SLOT(levelChanged(int))); @@ -118,15 +118,15 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): buttons->setLayout(new QHBoxLayout()); form->layout()->addWidget(buttons); - button = new QPushButton("Add component", buttons); + button = new QPushButton(tr("Add component"), buttons); buttons->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(addLevel())); - button = new QPushButton("Remove component", buttons); + button = new QPushButton(tr("Remove component"), buttons); buttons->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(removeLevel())); - form->layout()->addWidget(new QLabel("Component height")); + form->layout()->addWidget(new QLabel(tr("Component height"))); slider_height = new QSlider(form); slider_height->setOrientation(Qt::Horizontal); slider_height->setMinimumWidth(150); @@ -138,7 +138,7 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): form->layout()->addWidget(slider_height); QObject::connect(slider_height, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int))); - form->layout()->addWidget(new QLabel("Component scaling")); + form->layout()->addWidget(new QLabel(tr("Component scaling"))); slider_scaling = new QSlider(form); slider_scaling->setOrientation(Qt::Horizontal); slider_scaling->setMinimumWidth(150); @@ -154,19 +154,19 @@ DialogNoise::DialogNoise(QWidget *parent, NoiseGenerator* value): buttons->setLayout(new QHBoxLayout()); form->layout()->addWidget(buttons); - button = new QPushButton("Validate", buttons); + button = new QPushButton(tr("Validate"), buttons); buttons->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(accept())); - button = new QPushButton("Reset", buttons); + button = new QPushButton(tr("Reset"), buttons); buttons->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(revert())); - button = new QPushButton("Cancel", buttons); + button = new QPushButton(tr("Cancel"), buttons); buttons->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(reject())); - setWindowTitle("Paysages 3D - Noise editor"); + setWindowTitle(tr("Paysages 3D - Noise editor")); revert(); } @@ -217,7 +217,7 @@ void DialogNoise::revertToCurrent() n = noiseGetLevelCount(_current); for (i = 0; i < n; i++) { - levels->addItem(QString("Component %1").arg(i + 1)); + levels->addItem(QString(tr("Component %1")).arg(i + 1)); } previewLevel->redraw(); diff --git a/gui_qt/dialogrender.cpp b/gui_qt/dialogrender.cpp index 26acdf6..53edaa8 100644 --- a/gui_qt/dialogrender.cpp +++ b/gui_qt/dialogrender.cpp @@ -75,7 +75,7 @@ DialogRender::DialogRender(QWidget *parent): renderer = sceneryCreateStandardRenderer(); setModal(true); - setWindowTitle("Paysages 3D - Render"); + setWindowTitle(tr("Paysages 3D - Render")); setLayout(new QVBoxLayout()); scroll = new QScrollArea(this); diff --git a/gui_qt/dialogwanderer.cpp b/gui_qt/dialogwanderer.cpp index 7709755..74c6b43 100644 --- a/gui_qt/dialogwanderer.cpp +++ b/gui_qt/dialogwanderer.cpp @@ -11,7 +11,7 @@ DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool c QPushButton* button; setModal(true); - setWindowTitle("Paysages 3D - Explore"); + setWindowTitle(tr("Paysages 3D - Explore")); setLayout(new QHBoxLayout()); _wanderer = new WidgetWanderer(this, camera); @@ -21,18 +21,18 @@ DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool c panel->setLayout(new QVBoxLayout()); panel->setMaximumWidth(200); - button = new QPushButton("Reset camera", panel); + button = new QPushButton(tr("Reset camera"), panel); panel->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), _wanderer, SLOT(resetCamera())); if (camera_validable) { - button = new QPushButton("Validate as render camera", panel); + button = new QPushButton(tr("Validate as render camera"), panel); panel->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(validateCamera())); } - button = new QPushButton("Close", panel); + button = new QPushButton(tr("Close"), panel); panel->layout()->addWidget(button); QObject::connect(button, SIGNAL(clicked()), this, SLOT(reject())); diff --git a/gui_qt/formatmosphere.cpp b/gui_qt/formatmosphere.cpp index c96a2eb..a85486c 100644 --- a/gui_qt/formatmosphere.cpp +++ b/gui_qt/formatmosphere.cpp @@ -59,13 +59,13 @@ FormAtmosphere::FormAtmosphere(QWidget *parent): _definition = atmosphereCreateDefinition(); previewColor = new PreviewAtmosphereColor(this); - addPreview(previewColor, QString("Color preview")); + addPreview(previewColor, QString(tr("Color preview"))); - addInputDouble("Start distance", &_definition.distance_near, -500.0, 500.0, 5.0, 50.0); - addInputDouble("End distance", &_definition.distance_far, -500.0, 500.0, 5.0, 50.0); - addInputDouble("Masking power", &_definition.full_mask, 0.0, 1.0, 0.01, 0.1); - addInputBoolean("Lock color on haze", &_definition.auto_lock_on_haze); - addInputColor("Color", &_definition.color); + addInputDouble(tr("Start distance"), &_definition.distance_near, -500.0, 500.0, 5.0, 50.0); + addInputDouble(tr("End distance"), &_definition.distance_far, -500.0, 500.0, 5.0, 50.0); + addInputDouble(tr("Masking power"), &_definition.full_mask, 0.0, 1.0, 0.01, 0.1); + addInputBoolean(tr("Lock color on haze"), &_definition.auto_lock_on_haze); + addInputColor(tr("Color"), &_definition.color); revertConfig(); } diff --git a/gui_qt/formclouds.cpp b/gui_qt/formclouds.cpp index 47c4b60..af9b487 100644 --- a/gui_qt/formclouds.cpp +++ b/gui_qt/formclouds.cpp @@ -142,21 +142,21 @@ FormClouds::FormClouds(QWidget *parent): _definition = cloudsCreateDefinition(); _layer = cloudsLayerCreateDefinition(); - addPreview(new PreviewCloudsCoverage(parent), "Layer coverage (no lighting)"); - addPreview(new PreviewCloudsColor(parent), "Color and lighting"); + addPreview(new PreviewCloudsCoverage(parent), tr("Layer coverage (no lighting)")); + addPreview(new PreviewCloudsColor(parent), tr("Color and lighting")); - addInputDouble("Start altitude", &_layer.ymin, -10.0, 250.0, 0.5, 5.0); - addInputDouble("Max density altitude", &_layer.ycenter, -10.0, 250.0, 0.5, 5.0); - addInputDouble("End altitude", &_layer.ymax, -10.0, 250.0, 0.5, 5.0); - addInputNoise("Noise", _layer.noise); - addInputDouble("Coverage", &_layer.coverage, 0.0, 1.0, 0.01, 0.1); - addInputDouble("Scaling", &_layer.scaling, 1.0, 100.0, 0.5, 5.0); - addInputColor("Base color", &_layer.material.base); - addInputDouble("Light reflection", &_layer.material.reflection, 0.0, 1.0, 0.01, 0.1); - addInputDouble("Light reflection shininess", &_layer.material.shininess, 0.0, 20.0, 0.1, 1.0); - addInputDouble("Transparency depth", &_layer.transparencydepth, 0.0, 100.0, 0.5, 5.0); - addInputDouble("Light traversal depth", &_layer.lighttraversal, 0.0, 100.0, 0.5, 5.0); - addInputDouble("Minimum lighting", &_layer.minimumlight, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Start altitude"), &_layer.ymin, -10.0, 250.0, 0.5, 5.0); + addInputDouble(tr("Max density altitude"), &_layer.ycenter, -10.0, 250.0, 0.5, 5.0); + addInputDouble(tr("End altitude"), &_layer.ymax, -10.0, 250.0, 0.5, 5.0); + addInputNoise(tr("Noise"), _layer.noise); + addInputDouble(tr("Coverage"), &_layer.coverage, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Scaling"), &_layer.scaling, 1.0, 100.0, 0.5, 5.0); + addInputColor(tr("Base color"), &_layer.material.base); + addInputDouble(tr("Light reflection"), &_layer.material.reflection, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Light reflection shininess"), &_layer.material.shininess, 0.0, 20.0, 0.1, 1.0); + addInputDouble(tr("Transparency depth"), &_layer.transparencydepth, 0.0, 100.0, 0.5, 5.0); + addInputDouble(tr("Light traversal depth"), &_layer.lighttraversal, 0.0, 100.0, 0.5, 5.0); + addInputDouble(tr("Minimum lighting"), &_layer.minimumlight, 0.0, 1.0, 0.01, 0.1); revertConfig(); } diff --git a/gui_qt/formrender.cpp b/gui_qt/formrender.cpp index e31f609..9ee215b 100644 --- a/gui_qt/formrender.cpp +++ b/gui_qt/formrender.cpp @@ -18,16 +18,16 @@ FormRender::FormRender(QWidget *parent) : _height = 600; _camera = cameraCreateDefinition(); - addInput(new InputCamera(this, "Camera", &_camera)); - addInputInt("Quality", &_quality, 1, 10, 1, 1); - addInputInt("Image width", &_width, 100, 2000, 10, 100); - addInputInt("Image height", &_height, 100, 2000, 10, 100); + addInput(new InputCamera(this, tr("Camera"), &_camera)); + addInputInt(tr("Quality"), &_quality, 1, 10, 1, 1); + addInputInt(tr("Image width"), &_width, 100, 2000, 10, 100); + addInputInt(tr("Image height"), &_height, 100, 2000, 10, 100); - button = addButton("Start new render"); + button = addButton(tr("Start new render")); connect(button, SIGNAL(clicked()), this, SLOT(startRender())); - button = addButton("Show last render"); + button = addButton(tr("Show last render")); connect(button, SIGNAL(clicked()), this, SLOT(showRender())); - button = addButton("Save last render"); + button = addButton(tr("Save last render")); connect(button, SIGNAL(clicked()), this, SLOT(saveRender())); revertConfig(); @@ -71,10 +71,10 @@ void FormRender::saveRender() { QString filepath; - filepath = QFileDialog::getSaveFileName(this, "Choose a filename to save the last render"); + filepath = QFileDialog::getSaveFileName(this, tr("Choose a filename to save the last render")); if (!filepath.isNull()) { //renderSaveToFile((char*)filepath.toStdString().c_str()); - QMessageBox::information(this, "Message", "The picture " + filepath + " has been saved."); + QMessageBox::information(this, "Message", QString(tr("The picture %1 has been saved.")).arg(filepath)); } } diff --git a/gui_qt/formsky.cpp b/gui_qt/formsky.cpp index ec7fadb..307ec86 100644 --- a/gui_qt/formsky.cpp +++ b/gui_qt/formsky.cpp @@ -81,17 +81,17 @@ FormSky::FormSky(QWidget *parent): _definition = skyCreateDefinition(); previewWest = new PreviewSkyWest(this); - addPreview(previewWest, QString("West preview")); + addPreview(previewWest, QString(tr("West preview"))); previewEast = new PreviewSkyEast(this); - addPreview(previewEast, QString("East preview")); + addPreview(previewEast, QString(tr("East preview"))); - addInputDouble("Day time", &_definition.daytime, 0.0, 1.0, 0.01, 0.1); - addInputColorGradation("Sun color", &_definition.sun_color); - addInputDouble("Sun radius", &_definition.sun_radius, 0.0, 0.3, 0.01, 0.03); - addInputColorGradation("Zenith color", &_definition.zenith_color); - addInputColorGradation("Haze color", &_definition.haze_color); - addInputDouble("Haze height", &_definition.haze_height, 0.0, 1.0, 0.01, 0.1); - addInputDouble("Haze smoothing", &_definition.haze_smoothing, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Day time"), &_definition.daytime, 0.0, 1.0, 0.01, 0.1); + addInputColorGradation(tr("Sun color"), &_definition.sun_color); + addInputDouble(tr("Sun radius"), &_definition.sun_radius, 0.0, 0.3, 0.01, 0.03); + addInputColorGradation(tr("Zenith color"), &_definition.zenith_color); + addInputColorGradation(tr("Haze color"), &_definition.haze_color); + addInputDouble(tr("Haze height"), &_definition.haze_height, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Haze smoothing"), &_definition.haze_smoothing, 0.0, 1.0, 0.01, 0.1); revertConfig(); } diff --git a/gui_qt/formterrain.cpp b/gui_qt/formterrain.cpp index 45b8e79..c14474f 100644 --- a/gui_qt/formterrain.cpp +++ b/gui_qt/formterrain.cpp @@ -85,12 +85,12 @@ FormTerrain::FormTerrain(QWidget *parent): previewHeight = new PreviewTerrainHeight(this); previewColor = new PreviewTerrainColor(this); - addPreview(previewHeight, QString("Height preview (normalized)")); - addPreview(previewColor, QString("Textured preview (no shadow)")); + addPreview(previewHeight, QString(tr("Height preview (normalized)"))); + addPreview(previewColor, QString(tr("Textured preview (no shadow)"))); - addInputNoise("Noise", _definition.height_noise); - addInputDouble("Height", &_definition.height_factor, 0.0, 20.0, 0.1, 1.0); - addInputDouble("Scaling", &_definition.scaling, 1.0, 20.0, 0.1, 1.0); + addInputNoise(tr("Noise"), _definition.height_noise); + addInputDouble(tr("Height"), &_definition.height_factor, 0.0, 20.0, 0.1, 1.0); + addInputDouble(tr("Scaling"), &_definition.scaling, 1.0, 20.0, 0.1, 1.0); revertConfig(); } diff --git a/gui_qt/formwater.cpp b/gui_qt/formwater.cpp index 28ad82b..866a9f9 100644 --- a/gui_qt/formwater.cpp +++ b/gui_qt/formwater.cpp @@ -170,21 +170,21 @@ FormWater::FormWater(QWidget *parent): previewCoverage = new PreviewWaterCoverage(this); previewColor = new PreviewWaterColor(this); - addPreview(previewCoverage, QString("Coverage preview")); - addPreview(previewColor, QString("Rendered preview (without/with lighting)")); + addPreview(previewCoverage, QString(tr("Coverage preview"))); + addPreview(previewColor, QString(tr("Rendered preview (without/with lighting)"))); - addInputDouble("Height", &_definition.height, -10.0, 10.0, 0.1, 1.0); - addInputColor("Surface color", &_definition.material.base); - addInputDouble("Light reflection", &_definition.material.reflection, 0.0, 1.0, 0.01, 0.1); - addInputDouble("Shininess to light", &_definition.material.shininess, 0.0, 20.0, 0.1, 1.0); - addInputDouble("Transparency", &_definition.transparency, 0.0, 1.0, 0.001, 0.1); - addInputDouble("Reflection", &_definition.reflection, 0.0, 1.0, 0.001, 0.1); - addInputDouble("Transparency distance", &_definition.transparency_depth, 0.0, 20.0, 0.1, 1.0); - addInputColor("Depth color", &_definition.depth_color); - addInputDouble("Light-through distance", &_definition.lighting_depth, 0.0, 20.0, 0.1, 1.0); - addInputNoise("Waves noise", _definition.waves_noise); - addInputDouble("Waves height", &_definition.waves_noise_height, 0.0, 0.1, 0.001, 0.01); - addInputDouble("Waves scaling", &_definition.waves_noise_scale, 0.01, 1.0, 0.01, 0.1); + addInputDouble(tr("Height"), &_definition.height, -10.0, 10.0, 0.1, 1.0); + addInputColor(tr("Surface color"), &_definition.material.base); + addInputDouble(tr("Light reflection"), &_definition.material.reflection, 0.0, 1.0, 0.01, 0.1); + addInputDouble(tr("Shininess to light"), &_definition.material.shininess, 0.0, 20.0, 0.1, 1.0); + addInputDouble(tr("Transparency"), &_definition.transparency, 0.0, 1.0, 0.001, 0.1); + addInputDouble(tr("Reflection"), &_definition.reflection, 0.0, 1.0, 0.001, 0.1); + addInputDouble(tr("Transparency distance"), &_definition.transparency_depth, 0.0, 20.0, 0.1, 1.0); + addInputColor(tr("Depth color"), &_definition.depth_color); + addInputDouble(tr("Light-through distance"), &_definition.lighting_depth, 0.0, 20.0, 0.1, 1.0); + addInputNoise(tr("Waves noise"), _definition.waves_noise); + addInputDouble(tr("Waves height"), &_definition.waves_noise_height, 0.0, 0.1, 0.001, 0.01); + addInputDouble(tr("Waves scaling"), &_definition.waves_noise_scale, 0.01, 1.0, 0.01, 0.1); revertConfig(); } diff --git a/gui_qt/inputboolean.cpp b/gui_qt/inputboolean.cpp index 36fffcb..67a9f9b 100644 --- a/gui_qt/inputboolean.cpp +++ b/gui_qt/inputboolean.cpp @@ -19,11 +19,11 @@ void InputBoolean::updatePreview() { if (checkbox->checkState() == Qt::Checked) { - ((QLabel*)_preview)->setText("Yes"); + ((QLabel*)_preview)->setText(tr("Yes")); } else { - ((QLabel*)_preview)->setText("No"); + ((QLabel*)_preview)->setText(tr("No")); } BaseInput::updatePreview(); diff --git a/gui_qt/inputcamera.cpp b/gui_qt/inputcamera.cpp index d6f1988..837ab77 100644 --- a/gui_qt/inputcamera.cpp +++ b/gui_qt/inputcamera.cpp @@ -13,7 +13,7 @@ InputCamera::InputCamera(QWidget* form, QString label, CameraDefinition* value): _preview = new QWidget(form); - _control = new QPushButton("Edit", form); + _control = new QPushButton(tr("Edit"), form); _control->setMaximumWidth(150); connect((QPushButton*)_control, SIGNAL(clicked()), this, SLOT(editCamera())); diff --git a/gui_qt/inputcolor.cpp b/gui_qt/inputcolor.cpp index 6a76562..e858e0e 100644 --- a/gui_qt/inputcolor.cpp +++ b/gui_qt/inputcolor.cpp @@ -27,7 +27,7 @@ InputColor::InputColor(QWidget* form, QString label, Color* value): { _preview = new ColorPreview(form); _preview->setMinimumSize(50, 20); - _control = new QPushButton("Edit", form); + _control = new QPushButton(tr("Edit"), form); _control->setMaximumWidth(150); connect((QPushButton*)_control, SIGNAL(clicked()), this, SLOT(chooseColor())); diff --git a/gui_qt/inputcolorgradation.cpp b/gui_qt/inputcolorgradation.cpp index 85e4a7c..0741771 100644 --- a/gui_qt/inputcolorgradation.cpp +++ b/gui_qt/inputcolorgradation.cpp @@ -39,7 +39,7 @@ InputColorGradation::InputColorGradation(QWidget* form, QString label, ColorGrad _preview = new ColorGradationPreview(form, value); _preview->setMinimumSize(200, 20); - _control = new QPushButton("Edit", form); + _control = new QPushButton(tr("Edit"), form); _control->setMaximumWidth(150); connect((QPushButton*)_control, SIGNAL(clicked()), this, SLOT(editGradation())); diff --git a/gui_qt/inputnoise.cpp b/gui_qt/inputnoise.cpp index a43e308..53f9507 100644 --- a/gui_qt/inputnoise.cpp +++ b/gui_qt/inputnoise.cpp @@ -47,7 +47,7 @@ InputNoise::InputNoise(QWidget* form, QString label, NoiseGenerator* value): { _preview = new NoiseSmallPreview(form, value); _preview->setMinimumSize(100, 40); - _control = new QPushButton("Edit", form); + _control = new QPushButton(tr("Edit"), form); _control->setMaximumWidth(150); connect((QPushButton*)_control, SIGNAL(clicked()), this, SLOT(editNoise())); diff --git a/gui_qt/mainwindow.cpp b/gui_qt/mainwindow.cpp index 0c64275..8015379 100644 --- a/gui_qt/mainwindow.cpp +++ b/gui_qt/mainwindow.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include "formatmosphere.h" #include "formclouds.h" @@ -25,17 +27,36 @@ int main(int argc, char** argv) { + MainWindow* window; int result; paysagesInit(); QApplication app(argc, argv); - MainWindow window; + + QTranslator qtTranslator; + QTranslator myTranslator; + + if (myTranslator.load("paysages_" + QLocale::system().name(), "./i18n")) + { + app.installTranslator(&myTranslator); - window.show(); + qtTranslator.load("qt_" + QLocale::system().name()); + app.installTranslator(&qtTranslator); + } + else + { + qtTranslator.load("qt_en"); + app.installTranslator(&qtTranslator); + } + + window = new MainWindow(); + window->show(); result = app.exec(); + delete window; + paysagesQuit(); return result; } @@ -50,48 +71,48 @@ MainWindow::MainWindow(QWidget *parent) : tabs = new QTabWidget(this); form = new FormTerrain(tabs); - tabs->addTab(form, "Terrain"); + tabs->addTab(form, tr("Terrain")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormTextures(tabs); - tabs->addTab(form, "Textures"); + tabs->addTab(form, tr("Textures")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormWater(tabs); - tabs->addTab(form, "Water"); + tabs->addTab(form, tr("Water")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormAtmosphere(tabs); - tabs->addTab(form, "Atmosphere"); + tabs->addTab(form, tr("Atmosphere")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormSky(tabs); - tabs->addTab(form, "Sky"); + tabs->addTab(form, tr("Sky")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormClouds(tabs); - tabs->addTab(form, "Clouds"); + tabs->addTab(form, tr("Clouds")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormLighting(tabs); - tabs->addTab(form, "Lighting"); + tabs->addTab(form, tr("Lighting")); QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); form = new FormRender(tabs); - tabs->addTab(form, "Render"); + tabs->addTab(form, tr("Render")); //QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll())); - menu = menuBar()->addMenu("Scene"); - menu->addAction("New", this, SLOT(fileNew()), QKeySequence(Qt::CTRL + Qt::Key_N)); + menu = menuBar()->addMenu(tr("&Scene")); + menu->addAction(tr("&New"), this, SLOT(fileNew()), QKeySequence(tr("Crtl+N"))); menu->addSeparator(); - menu->addAction("Save", this, SLOT(fileSave()), QKeySequence(Qt::CTRL + Qt::Key_S)); - menu->addAction("Open", this, SLOT(fileLoad()), QKeySequence(Qt::CTRL + Qt::Key_O)); + menu->addAction(tr("&Save"), this, SLOT(fileSave()), QKeySequence(tr("Crtl+S"))); + menu->addAction(tr("&Open"), this, SLOT(fileLoad()), QKeySequence(tr("Crtl+O"))); menu->addSeparator(); - menu->addAction("Quit", this, SLOT(close()), QKeySequence(Qt::CTRL + Qt::Key_Q)); + menu->addAction(tr("&Quit"), this, SLOT(close()), QKeySequence(tr("Crtl+Q"))); - menu = menuBar()->addMenu("Actions"); - menu->addAction("Explore in 3D", this, SLOT(explore3D()), QKeySequence("F2")); - menu->addAction("Quick render", this, SLOT(quickPreview()), QKeySequence("F5")); + menu = menuBar()->addMenu(tr("&Actions")); + menu->addAction(tr("&Explore in 3D"), this, SLOT(explore3D()), QKeySequence("F2")); + menu->addAction(tr("&Quick render"), this, SLOT(quickPreview()), QKeySequence("F5")); setCentralWidget(tabs); diff --git a/gui_qt/paysages-qt.pro b/gui_qt/paysages-qt.pro index f13fd1d..86051d2 100644 --- a/gui_qt/paysages-qt.pro +++ b/gui_qt/paysages-qt.pro @@ -13,3 +13,7 @@ win32:LIBS += $$DESTDIR/libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread- HEADERS += $$files(*.h) $$files(../lib_paysages/*.h) $$files(../lib_paysages/shared/*.h) SOURCES += $$files(*.cpp) +TRANSLATIONS = ../i18n/paysages_fr.ts + +system(lupdate paysages-qt.pro) +system(lrelease $$TRANSLATIONS) diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts new file mode 100644 index 0000000..3ec95c3 --- /dev/null +++ b/i18n/paysages_fr.ts @@ -0,0 +1,623 @@ + + + + + BaseForm + + + Layers : + Niveaux : + + + + Add layer + Ajouter un niveau + + + + Delete layer + Supprimer un niveau + + + + Apply + Appliquer + + + + Revert + Annuler les modifications + + + + Layer %1 + Niveau %1 + + + + DialogColorGradation + + + Paysages 3D - Color gradation editor + Paysages 3D - Editeur de gradients de couleur + + + + DialogNoise + + + Level preview + Aperçu du composant + + + + Total preview + Aperçu du total + + + + Noise components + Composants du bruit + + + + Add component + Ajouter un composant + + + + Remove component + Supprimer un composant + + + + Component height + Hauteur du composant + + + + Component scaling + Echelle du composant + + + + Validate + Valider + + + + Reset + Recommencer + + + + Cancel + Annuler + + + + Paysages 3D - Noise editor + Paysages 3D - Editeur de bruit + + + + Component %1 + Composant %1 + + + + DialogRender + + + Paysages 3D - Render + Paysages 3D - Rendu + + + + DialogWanderer + + + Paysages 3D - Explore + Paysages 3D - Exploration + + + + Reset camera + Revenir au point de vue initial + + + + Validate as render camera + Valider comme caméra de rendu + + + + Close + Fermer + + + + FormAtmosphere + + + Color preview + Aperçu de la couleur + + + + Start distance + Distance de début + + + + End distance + Distance de fin + + + + Masking power + Opacité maximale + + + + Lock color on haze + Verrouiller sur la couleur de la brume + + + + Color + Couleur + + + + FormClouds + + + Layer coverage (no lighting) + Couverture de la couche (sans éclairage) + + + + Color and lighting + Echantillon éclairé + + + + Start altitude + Altitude de début + + + + Max density altitude + Altitude de densité maximale + + + + End altitude + Altitude de fin + + + + Noise + Bruit + + + + Coverage + Couverture + + + + Scaling + Echelle + + + + Base color + Couleur de base + + + + Light reflection + Facteur de réflexion de la lumière + + + + Light reflection shininess + Concentration de la réflexion de lumière + + + + Transparency depth + Distance de transparence + + + + Light traversal depth + Distance de traversée de la lumière + + + + Minimum lighting + Eclairage minimal + + + + FormColorGradation + + + Preview + Aperçu + + + + Position + Position + + + + Color + Couleur + + + + Validate + Valider + + + + Revert + Recommencer + + + + Cancel + Annuler + + + + FormRender + + + Camera + Caméra + + + + Quality + Qualité de rendu + + + + Image width + Largeur de l'image + + + + Image height + Hauteur de l'image + + + + Start new render + Démarrer un rendu + + + + Show last render + Voir le dernier rendu + + + + Save last render + Sauvegarder le dernier rendu + + + + Choose a filename to save the last render + Choisissez un nom de fichier pour le rendu + + + + The picture %1 has been saved. + L'image %1 a été sauvegardée. + + + + FormSky + + + West preview + Aperçu de l'ouest + + + + East preview + Aperçu de l'est + + + + Day time + Heure du jour + + + + Sun color + Couleur du soleil + + + + Sun radius + Diamètre apparent du soleil + + + + Zenith color + Couleur du ciel au zénith + + + + Haze color + Couleur de la brume + + + + Haze height + Hauteur apparente de la brume + + + + Haze smoothing + Facteur de lissage de la brume + + + + FormTerrain + + + Height preview (normalized) + Aperçu de la hauteur (normalisée) + + + + Textured preview (no shadow) + Aperçu du rendu (sans ombres) + + + + Noise + Bruit + + + + Height + Hauteur + + + + Scaling + Echelle + + + + FormWater + + + Coverage preview + Aperçu de la couverture + + + + Rendered preview (without/with lighting) + Aperçu du rendu (sans/avec éclairage) + + + + Height + Hauteur + + + + Surface color + Couleur de la surface + + + + Light reflection + Réflection de la lumière + + + + Shininess to light + Concentration de la lumière réfléchie + + + + Transparency + Transparence + + + + Reflection + Reflets + + + + Transparency distance + Distance maximale de transparence + + + + Depth color + Couleur en profondeur + + + + Light-through distance + Distance de filtrage de la lumière + + + + Waves noise + Bruit des vagues + + + + Waves height + Hauteur des vagues + + + + Waves scaling + Echelle des vagues + + + + InputBoolean + + + Yes + Oui + + + + No + Non + + + + InputCamera + + + Edit + Editer + + + + InputColor + + + Edit + Editer + + + + InputColorGradation + + + Edit + Editer + + + + InputNoise + + + Edit + Editer + + + + MainWindow + + + Terrain + Terrain + + + + Textures + Textures + + + + Water + Eau + + + + Atmosphere + Atmosphère + + + + Sky + Ciel + + + + Clouds + Nuages + + + + Lighting + Eclairage + + + + Render + Rendu + + + + &Scene + &Scène + + + + &New + &Nouvelle + + + + Crtl+N + Ctrl+N + + + + &Save + &Sauvegarder + + + + Crtl+S + Ctrl+S + + + + &Open + &Ouvrir + + + + Crtl+O + Ctrl+O + + + + &Quit + &Quitter + + + + Crtl+Q + Ctrl+Q + + + + &Actions + &Actions + + + + &Explore in 3D + &Explorer en 3D + + + + &Quick render + Rendu r&apide + + +