diff --git a/common/project.cpp b/common/project.cpp index 8d5c12da..85c88c74 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -965,7 +965,8 @@ bool Project::OnOpenDocument(const char* lpszPathName) return false; } - LoadLDraw(QTextStream(&File)); + QTextStream Stream(&File); + LoadLDraw(Stream); } mCurrentStep = step; @@ -1032,7 +1033,9 @@ void Project::CheckPoint(const char* Description) void Project::LoadCheckPoint(lcModelHistoryEntry* CheckPoint) { DeleteContents(true); - LoadLDraw(QTextStream(CheckPoint->File, QIODevice::ReadOnly)); + + QTextStream Stream(CheckPoint->File, QIODevice::ReadOnly); + LoadLDraw(Stream); const lcArray Views = gMainWindow->GetViews(); for (int i = 0; i < Views.GetSize (); i++) diff --git a/leocad.pro b/leocad.pro index 48281fce..0ce721fc 100644 --- a/leocad.pro +++ b/leocad.pro @@ -22,6 +22,22 @@ win32 { QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter } +isEmpty(QMAKE_LRELEASE) { + win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe + else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease + unix { + !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 } + } else { + !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease } + } +} + +lrelease.input = TRANSLATIONS +lrelease.output = resources/${QMAKE_FILE_BASE}.qm +lrelease.commands = $$QMAKE_LRELEASE -silent ${QMAKE_FILE_IN} -qm resources/${QMAKE_FILE_BASE}.qm +lrelease.CONFIG += no_link target_predeps +QMAKE_EXTRA_COMPILERS += lrelease + unix:!macx { TARGET = leocad } else { @@ -220,3 +236,4 @@ FORMS += \ qt/lc_qfinddialog.ui OTHER_FILES += RESOURCES += leocad.qrc +TRANSLATIONS = resources/leocad_pt_BR.ts diff --git a/leocad.qrc b/leocad.qrc index 22059896..3949cc88 100644 --- a/leocad.qrc +++ b/leocad.qrc @@ -67,5 +67,6 @@ resources/piece_show_later.png resources/time_add_keys.png resources/library.zip + resources/leocad_pt_BR.qm diff --git a/qt/qtmain.cpp b/qt/qtmain.cpp index 1d293348..c81a781d 100644 --- a/qt/qtmain.cpp +++ b/qt/qtmain.cpp @@ -132,6 +132,10 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationName("LeoCAD"); QCoreApplication::setApplicationVersion(LC_VERSION_TEXT); + QTranslator Translator; + Translator.load(QString("leocad_") + QLocale::system().name() + ".qm", ":/resources"); + app.installTranslator(&Translator); + g_App = new lcApplication(); gMainWindow = new lcMainWindow(); diff --git a/resources/leocad_pt_BR.ts b/resources/leocad_pt_BR.ts new file mode 100644 index 00000000..20d59449 --- /dev/null +++ b/resources/leocad_pt_BR.ts @@ -0,0 +1,1461 @@ + + + + + Project + + + + + Error + + + + + Saving files in LCD format is no longer supported, please use the LDR format instead. + + + + + Error writing to file '%1': +%2 + + + + + Error reading file '%1': +%2 + + + + + New SpotLight + + + + + New Camera + + + + + Move + + + + + Rotate + + + + + + Zoom + + + + + Pan + + + + + Orbit + + + + + Roll + + + + + Insert + + + + + New Light + + + + + Deleting + + + + + Painting + + + + + lcBaseWindow + + + Open Project + + + + + + Supported Files (*.lcd *.ldr *.dat *.mpd);;All Files (*.*) + + + + + Save Project + + + + + Supported Files (*.ldr *.dat);;All Files (*.*) + + + + + Merge Project + + + + + Export 3D Studio + + + + + 3DS Files (*.3ds);;All Files (*.*) + + + + + Export BrickLink + + + + + XML Files (*.xml);;All Files (*.*) + + + + + Export CSV + + + + + CSV Files (*.csv);;All Files (*.*) + + + + + Export Wavefront + + + + + Wavefront Files (*.obj);;All Files (*.*) + + + + + lcQAboutDialog + + + About LeoCAD + + + + + LeoCAD Version 0.00.0 + + + + + LeoCAD is a free application that can be used to create virtual LEGO models. + + + + + <a href="http://www.leocad.org">http://www.leocad.org</a> + + + + + System Information + + + + + LeoCAD Version + + + + + lcQArrayDialog + + + Array + + + + + Dimensions + + + + + Offsets + + + + + Rotations + + + + + Array is empty. + + + + + lcQCategoryDialog + + + Category + + + + + Name: + + + + + Keywords: + + + + + Edit Category + + + + + New Category + + + + + Name cannot be empty. + + + + + Keywords cannot be empty. + + + + + lcQEditGroupsDialog + + + Edit Groups + + + + + New Group + + + + + lcQFindDialog + + + Find + + + + + Name + + + + + Part ID + + + + + Color + + + + + lcQGroupDialog + + + Group + + + + + Name + + + + + Name cannot be empty. + + + + + lcQHTMLDialog + + + HTML Options + + + + + General + + + + + Output folder: + + + + + ... + + + + + Image format: + + + + + BMP + + + + + JPEG + + + + + PNG + + + + + Transparent image background + + + + + Layout + + + + + Single page + + + + + One step per page + + + + + + Width: + + + + + + Height: + + + + + Index page + + + + + Highlight new parts + + + + + Parts List + + + + + At the end + + + + + After each step + + + + + Color: + + + + + Create images + + + + + Output folder cannot be empty. + + + + + Select Output Folder + + + + + lcQImageDialog + + + Save Image + + + + + File name: + + + + + Format: + + + + + Width: + + + + + Height: + + + + + BMP + + + + + JPEG + + + + + PNG + + + + + ... + + + + + Transparent background + + + + + First step: + + + + + Last step: + + + + + Output File cannot be empty. + + + + + Please enter a width between 1 and 2048. + + + + + Please enter a height between 1 and 2048. + + + + + First step must be between 1 and 9999. + + + + + Last step must be between 1 and 9999. + + + + + Last step must be greater than first step. + + + + + Save Image File + + + + + Supported Files (*.bmp *.png *.jpg);;BMP Files (*.bmp);;PNG Files (*.png);;JPEG Files (*.jpg);;All Files (*.*) + + + + + lcQMainWindow + + + New Project + Novo Projeto + + + + Open Project + + + + + Save Project + + + + + Lock Menu + + + + + Snap XY + + + + + Snap Z + + + + + Snap Menu + + + + + Snap Angle Menu + + + + + Transform + + + + + C&ameras + + + + + &File + + + + + &Export + + + + + &Edit + + + + + &View + + + + + &Viewpoints + + + + + Projection + + + + + Ste&p + + + + + T&oolbars + + + + + &Piece + + + + + &Help + + + + + Standard + + + + + Tools + + + + + Time + + + + + Parts + + + + + Properties + + + + + Step %1 + + + + + M: %1 %2 R: %3 + + + + + &Undo %1 + + + + + &Undo + + + + + &Redo %1 + + + + + &Redo + + + + + lcQMinifigDialog + + + Dialog + + + + + lcQPOVRayDialog + + + POV-Ray Export + + + + + Output File + + + + + POV-Ray Executable + + + + + LGEO Path (optional) + + + + + Render Scene + + + + + + + ... + + + + + Output File cannot be empty. + + + + + Save POV-Ray File + + + + + POV-Ray Files (*.pov);;All Files (*.*) + + + + + Executable Files (*.exe);;All Files (*.*) + + + + + All Files (*.*) + + + + + Open POV-Ray Executable + + + + + Open LGEO Folder + + + + + lcQPartsTree + + + Search Results + + + + + lcQPreferencesDialog + + + Preferences + + + + + General + + + + + Default author name: + + + + + Default projects folder: + + + + + + + + ... + + + + + Custom parts library: + + + + + POV-Ray Executable: + + + + + LGEO Path: + + + + + Mouse sensitivity: + + + + + Check for updates: + + + + + Never + + + + + Once a day + + + + + Once a week + + + + + Don't allow relative snap + + + + + Fixed direction keys + + + + + Rendering + + + + + Edge lines + + + + + Axis icon + + + + + width + + + + + Anti-aliasing + + + + + Enable lighting + + + + + 2x + + + + + 4x + + + + + 8x + + + + + Base Grid + + + + + Draw studs + + + + + studs + + + + + Draw lines every + + + + + + Categories + + + + + Parts Library Categories + + + + + Name + + + + + Number + + + + + + Import... + + + + + + Export... + + + + + + Reset... + + + + + Category + + + + + New... + + + + + Edit... + + + + + Delete... + + + + + Keyboard + + + + + Keyboard Shortcuts + + + + + Command + + + + + + Shortcut + + + + + Key sequence: + + + + + Assign + + + + + Remove + + + + + Grid spacing must be greater than 0. + + + + + Open Projects Folder + + + + + Open Parts Library Folder + + + + + Executable Files (*.exe);;All Files (*.*) + + + + + All Files (*.*) + + + + + Open POV-Ray Executable + + + + + Open LGEO Folder + + + + + Select Grid Stud Color + + + + + Select Grid Line Color + + + + + Unassigned + + + + + Are you sure you want to delete the category '%1'? + + + + + Import Categories + + + + + + + + Text Files (*.txt);;All Files (*.*) + + + + + Error loading categories file. + + + + + Export Categories + + + + + Error saving categories file. + + + + + Are you sure you want to load the default categories? + + + + + Import shortcuts + + + + + Error loading keyboard shortcuts file. + + + + + Export shortcuts + + + + + Error saving keyboard shortcuts file. + + + + + Are you sure you want to load the default keyboard shortcuts? + + + + + lcQPropertiesDialog + + + Properties + + + + + Summary + + + + + Author: + + + + + Description: + + + + + Comments: + + + + + Scene + + + + + Background + + + + + Solid Color + + + + + Image + + + + + Gradient + + + + + ... + + + + + Tile + + + + + Environment + + + + + Fog + + + + + Density + + + + + Ambient Light + + + + + Set default options for new projects + + + + + Parts Used + + + + + %1 Properties + + + + + Part + + + + + Select Background Color + + + + + Select Background Top Color + + + + + Select Background Bottom Color + + + + + Select Fog Color + + + + + Select Ambient Light Color + + + + + Select Background Image + + + + + All Image Files (*.png *.jpg *.gif *.bmp);;PNG Files (*.png);;JPEG Files (*.jpg);;GIF Files (*.gif);;BMP Files (*.bmp);;All Files (*.*) + + + + + lcQPropertiesTree + + + Property + + + + + Value + + + + + + Position + + + + + + + + + X + + + + + + + + + Y + + + + + + + + + Z + + + + + Rotation + + + + + Visibility + + + + + Show + + + + + Hide + + + + + Appearance + + + + + Color + + + + + Part + + + + + Target + + + + + + Up + + + + + Orthographic + + + + + FOV + + + + + Near + + + + + Far + + + + + Name + + + + + lcQSelectDialog + + + Select Objects + + + + + All + + + + + None + + + + + Invert + + + + + lcQUpdateDialog + + + LeoCAD Updates + + + + + Connecting to update server... + + + + + <p>There's a newer version of LeoCAD available for download (%1.%2.%3).</p> + + + + + <p>You are using the latest LeoCAD version.</p> + + + + + <p>There are new parts available.</p> + + + + + <p>There are no new parts available at this time.</p> + + + + + <p>Visit <a href="http://www.leocad.org/files/">http://www.leocad.org/files/</a> to download.</p> + + + + + Error parsing update information. + + + + + Error connecting to the update server. + + + +