Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
40252cd
multilanguage support: initial commit #378
VBelozyorov Oct 24, 2013
eb87458
robomongo_dummy.ts
VBelozyorov Oct 26, 2013
b153589
intermediate. lang menu, need to restart for language changing
VBelozyorov Oct 27, 2013
16ab545
*.ts stuff
VBelozyorov Oct 27, 2013
721436c
"System locale" retranslating
VBelozyorov Oct 28, 2013
3159725
AboutDialog translating
VBelozyorov Oct 29, 2013
ec8c37d
script improved
VBelozyorov Oct 29, 2013
1ad0b22
translations
VBelozyorov Oct 29, 2013
49e9e7a
gitignore in lang subdirectory
VBelozyorov Oct 30, 2013
75e1223
Merge branch 'master' of https://github.com/paralect/robomongo into m…
VBelozyorov Oct 30, 2013
f887465
removing dynamically created ts after compilation
VBelozyorov Oct 31, 2013
16c93e6
rephrase
VBelozyorov Oct 31, 2013
241971a
ConnectionsDialog translating
VBelozyorov Oct 31, 2013
faac066
more translations
VBelozyorov Oct 31, 2013
76447c2
changes
VBelozyorov Nov 2, 2013
f9ff4fd
ExplorerDatabaseTreeItem tr() calls
VBelozyorov Nov 2, 2013
90704ee
ExplorerFunctionTreeItem tr() calls
VBelozyorov Nov 2, 2013
fa09d40
ExplorerUserTreeItem tr() calls
VBelozyorov Nov 2, 2013
9fa0bc1
ExplorerServerTreeItem tr() calls
VBelozyorov Nov 2, 2013
d078cb2
LogWidget tr() calls
VBelozyorov Nov 2, 2013
3f03cf9
more tr() calls
VBelozyorov Nov 2, 2013
1bfc2aa
Merge remote-tracking branch 'paralect/master' into multilanguage
VBelozyorov Nov 2, 2013
c2627bf
readme about ts stuff
VBelozyorov Nov 2, 2013
b517dc9
ts_compile mapping sorted
VBelozyorov Nov 2, 2013
7612c96
tr() calls
VBelozyorov Nov 2, 2013
2e65ebf
fixes
VBelozyorov Nov 2, 2013
4c742ef
translations update
VBelozyorov Nov 2, 2013
462f144
Language menu moved to Options section
VBelozyorov Nov 2, 2013
8c952b0
readme updated
VBelozyorov Nov 2, 2013
92e3be5
Merge branch 'master' into multilanguage
VBelozyorov Dec 21, 2013
432d4ac
Git ignore *.orig files
VBelozyorov Dec 22, 2013
d274fbe
Generating *.ts and *.qm with CMake
VBelozyorov Dec 22, 2013
8afcd29
Removing junk files related to translation
VBelozyorov Dec 22, 2013
1159d8e
Initial EN translation
VBelozyorov Dec 22, 2013
3ffae89
Initial RU translation
VBelozyorov Dec 22, 2013
6409204
Changes in comments because lupdate utility says: "Discarding unconsu…
VBelozyorov Dec 22, 2013
7bc44ca
Another language switching. Intermediate.
VBelozyorov Dec 25, 2013
d32a3e8
Switching of translations in runtime for MainWindow
VBelozyorov Dec 31, 2013
fd822b5
RU translation
VBelozyorov Dec 31, 2013
7b2dd3e
retranslateUI method for ExplorerTreeItem
VBelozyorov Jan 1, 2014
b5492b0
ExplorerWidget: retranslating items
VBelozyorov Jan 1, 2014
405b2eb
Retranslating of ExplorerCollectionTreeItem
VBelozyorov Jan 1, 2014
ad3a76e
Retranslating of ExplorerDatabaseCategoryTreeItem
VBelozyorov Jan 1, 2014
7843ac2
Retranslating of ExplorerDatabaseTreeItem
VBelozyorov Jan 1, 2014
1b0a57c
Retranslating of ExplorerTreeItem
VBelozyorov Jan 1, 2014
0690006
Retranslating of ExplorerServerTreeItem
VBelozyorov Jan 1, 2014
27bcbc7
Retranslating of ExplorerUserTreeItem
VBelozyorov Jan 1, 2014
e131d9e
'System locale' language fixes
VBelozyorov Jan 1, 2014
118e482
Loading qt_xx.qm
VBelozyorov Jan 1, 2014
b2429b6
File qt_ru.qm
VBelozyorov Jan 1, 2014
8abc4e5
Small changes in MainWindow
VBelozyorov Jan 2, 2014
3d174e4
Retranslating of LogWidget
VBelozyorov Jan 2, 2014
fbdaa0b
Retranslating of BsonTreeView
VBelozyorov Jan 2, 2014
7f165b3
Retranslating of WorkAreaTabBar
VBelozyorov Jan 2, 2014
b36d116
Retranslating of PagingWidget
VBelozyorov Jan 2, 2014
9709e9d
Retranslating of OutputItemHeaderWidget
VBelozyorov Jan 2, 2014
a99e9d1
Retranslating of CollectionStatsTreeWidget
VBelozyorov Jan 2, 2014
7c1fad2
Retranslating of OutputItemContentWidget
VBelozyorov Jan 2, 2014
ff020be
Removing redundant field from AppRegistry
VBelozyorov Jan 2, 2014
55bc541
Small refactoring of SettingsManager
VBelozyorov Jan 2, 2014
086cd49
Using dynamic_cast in retranslating of ExplorerTree items
VBelozyorov Jan 6, 2014
c864906
Added german translation
Feb 24, 2014
1a08239
Merge pull request #1 from Cornyfisch/multilanguage
VBelozyorov Feb 24, 2014
da299a3
Name of the language for the menu item
VBelozyorov Feb 24, 2014
129ca82
Starting to be translated into Brazilian Portuguese.
marceloboeira May 26, 2014
6373319
50% of Brazilian Portuguese Translation.
marceloboeira May 26, 2014
558b683
100% of Brazilian Portuguese Translation (Needs to verify shortcuts)
marceloboeira May 27, 2014
ccb580f
Merge pull request #2 from marceloboeira/multilanguage
VBelozyorov May 27, 2014
f66fe1c
More russian translations
VBelozyorov May 26, 2014
20a18a7
Brazilian Portuguese translation added to cmake 'translations' target
VBelozyorov May 27, 2014
4afdad0
Translations updated in accordance with the source files
VBelozyorov May 27, 2014
f9d4f1a
Merge branch 'master' into multilanguage
VBelozyorov May 30, 2014
b121fea
Translations in DialogUtils
VBelozyorov May 31, 2014
20758ec
Translations fixes in Notifier
VBelozyorov May 31, 2014
ed758b7
Translation for "Ctrl"
VBelozyorov May 31, 2014
0fafd2f
Translations near numerals
VBelozyorov May 31, 2014
65f3a3e
Translations update
VBelozyorov May 31, 2014
86308ec
Context specified for __LANGUAGE_NAME__ string
VBelozyorov Jun 3, 2014
2172067
More translations contexts
VBelozyorov Jun 3, 2014
8ce5dc6
Translation fixes in SshTunelTab
VBelozyorov Jun 3, 2014
9001434
Typo in three dots
VBelozyorov Jun 3, 2014
14c2805
Finished RU translations
VBelozyorov Jun 7, 2014
4f8f6c2
Updated translations
VBelozyorov Jun 7, 2014
c1b558f
Merge branch 'master' of https://github.com/paralect/robomongo into m…
VBelozyorov Jun 7, 2014
4fb5569
Translations updated after merge
VBelozyorov Jun 7, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CMakeLists.txt.user*
target/
libs/

*.orig
/build
/build2

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OPTION(CPACK_SUPPORT "Enable package support" ON)
OPTION(DEVELOPER_DYNAMIC_RUNTIME "Build with dynamic C++ runtime" ON)
OPTION(DEVELOPER_FEATURES "Use some debug tricks for developers" OFF)
OPTION(DEVELOPER_ENABLE_TESTS "Enable tests for ${PROJECT_NAME_TITLE} project" ON)
OPTION(UPDATE_TRANSLATIONS "Update translations (*.ts files)" OFF)

IF(MSVC)
IF(CMAKE_CL_64)
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ SET(PCRE_BUILD_TESTS OFF CACHE BOOL "Build the tests pcre tests.")
SET(PCRE_BUILD_PCREGREP OFF CACHE BOOL "Build pcregrep")
ADD_SUBDIRECTORY(third-party/mongodb/src/third_party/pcre-8.30 pcrecpp)

ADD_SUBDIRECTORY(robomongo/lang lang)

SET(HEADERS_GUI_TO_MOC
robomongo/gui/dialogs/ConnectionsDialog.h
robomongo/gui/dialogs/ConnectionDialog.h
Expand Down Expand Up @@ -442,6 +444,7 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${TARGET_INSTALL_DESTINATION} COMPON
INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION . COMPONENT LICENSE)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/COPYRIGHT DESTINATION . COMPONENT LICENSE)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/whats-new.txt DESTINATION . COMPONENT LICENSE RENAME CHANGELOG)
INSTALL(FILES ${QM_FILES} DESTINATION ${LIB_INSTALL_DESTINATION}/translations)
INSTALL_QT(${PROJECT_NAME} ${LIB_INSTALL_DESTINATION})

IF(WIN32)
Expand Down
12 changes: 9 additions & 3 deletions src/robomongo/app/main.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QtCore>

#include <locale.h>

#include "robomongo/gui/MainWindow.h"
#include "robomongo/gui/AppStyle.h"
#include "robomongo/core/AppRegistry.h"
#include "robomongo/core/settings/SettingsManager.h"
#include "robomongo/core/utils/Logger.h"

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Robomongo::detail::initStyle();
setlocale(LC_NUMERIC,"C"); // do not move this line!!!

Robomongo::detail::initStyle();
setlocale(LC_NUMERIC, "C"); // do not move this line!!!

Robomongo::AppRegistry::instance().settingsManager()->switchTranslator(Robomongo::AppRegistry::instance().settingsManager()->currentTranslation(), true);

QRect screenGeometry = QApplication::desktop()->availableGeometry();
QSize size(screenGeometry.width() - 450, screenGeometry.height() - 165);

Expand Down
4 changes: 3 additions & 1 deletion src/robomongo/core/AppRegistry.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <QApplication>

#include "robomongo/core/Core.h"
#include "robomongo/core/utils/SingletonPattern.hpp"

Expand All @@ -15,7 +17,7 @@ namespace Robomongo
SettingsManager *const settingsManager() const { return _settingsManager.get(); }
App *const app() const { return _app.get(); }
EventBus *const bus() const { return _bus.get(); }

private:
AppRegistry();
~AppRegistry();
Expand Down
30 changes: 15 additions & 15 deletions src/robomongo/core/domain/Notifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ namespace Robomongo
QWidget *wid = dynamic_cast<QWidget*>(_observer);
AppRegistry::instance().bus()->subscribe(this, InsertDocumentResponse::Type);

_deleteDocumentAction = new QAction("Delete Document...", wid);
_deleteDocumentAction = new QAction(tr("Delete Document..."), wid);
VERIFY(connect(_deleteDocumentAction, SIGNAL(triggered()), SLOT(onDeleteDocument())));

_deleteDocumentsAction = new QAction("Delete Documents...", wid);
_deleteDocumentsAction = new QAction(tr("Delete Documents..."), wid);
VERIFY(connect(_deleteDocumentsAction, SIGNAL(triggered()), SLOT(onDeleteDocuments())));

_editDocumentAction = new QAction("Edit Document...", wid);
_editDocumentAction = new QAction(tr("Edit Document..."), wid);
VERIFY(connect(_editDocumentAction, SIGNAL(triggered()), SLOT(onEditDocument())));

_viewDocumentAction = new QAction("View Document...", wid);
_viewDocumentAction = new QAction(tr("View Document..."), wid);
VERIFY(connect(_viewDocumentAction, SIGNAL(triggered()), SLOT(onViewDocument())));

_insertDocumentAction = new QAction("Insert Document...", wid);
_insertDocumentAction = new QAction(tr("Insert Document..."), wid);
VERIFY(connect(_insertDocumentAction, SIGNAL(triggered()), SLOT(onInsertDocument())));

_copyValueAction = new QAction("Copy Value", wid);
_copyValueAction = new QAction(tr("Copy Value"), wid);
VERIFY(connect(_copyValueAction, SIGNAL(triggered()), SLOT(onCopyDocument())));

_copyJsonAction = new QAction("Copy JSON", wid);
_copyJsonAction = new QAction(tr("Copy JSON"), wid);
VERIFY(connect(_copyJsonAction, SIGNAL(triggered()), SLOT(onCopyJson())));
}

Expand Down Expand Up @@ -138,8 +138,8 @@ namespace Robomongo
mongo::BSONElement id = obj.getField("_id");

if (id.eoo()) {
QMessageBox::warning(dynamic_cast<QWidget*>(_observer), "Cannot delete", "Selected document doesn't have _id field. \n"
"Maybe this is a system document that should be managed in a special way?");
QMessageBox::warning(dynamic_cast<QWidget*>(_observer), tr("Cannot delete"), tr("Selected document doesn't have _id field. \n"
"Maybe this is a system document that should be managed in a special way?"));
break;
}

Expand All @@ -150,8 +150,8 @@ namespace Robomongo

if (!force) {
// Ask user
int answer = utils::questionDialog(dynamic_cast<QWidget*>(_observer), "Delete",
"Document", "%1 %2 with id:<br><b>%3</b>?", QtUtils::toQString(id.toString(false)));
int answer = utils::questionDialog(dynamic_cast<QWidget*>(_observer), tr("Delete"),
tr("Document"), tr("%1 %2 with id:<br><b>%3</b>?"), QtUtils::toQString(id.toString(false)));

if (answer != QMessageBox::Yes)
break;
Expand All @@ -178,7 +178,7 @@ namespace Robomongo
QModelIndexList selectedIndexes = _observer->selectedIndexes();
if (!detail::isMultySelection(selectedIndexes))
return;
int answer = QMessageBox::question(dynamic_cast<QWidget*>(_observer), "Delete", QString("Do you want to delete %1 selected documents?").arg(selectedIndexes.count()));
int answer = QMessageBox::question(dynamic_cast<QWidget*>(_observer), tr("Delete"), tr("Do you want to delete %n selected documents?", "", selectedIndexes.count()));
if (answer == QMessageBox::Yes) {
std::vector<BsonTreeItem*> items;
for (QModelIndexList::const_iterator it = selectedIndexes.begin(); it!= selectedIndexes.end(); ++it) {
Expand Down Expand Up @@ -228,7 +228,7 @@ namespace Robomongo
DocumentTextEditor editor(_queryInfo._info,
json, false, dynamic_cast<QWidget*>(_observer));

editor.setWindowTitle("Edit Document");
editor.setWindowTitle(tr("Edit Document"));
int result = editor.exec();

if (result == QDialog::Accepted) {
Expand Down Expand Up @@ -257,7 +257,7 @@ namespace Robomongo
DocumentTextEditor *editor = new DocumentTextEditor(_queryInfo._info,
json, true, dynamic_cast<QWidget*>(_observer));

editor->setWindowTitle("View Document");
editor->setWindowTitle(tr("View Document"));
editor->show();
}

Expand All @@ -270,7 +270,7 @@ namespace Robomongo
"{\n \n}", false, dynamic_cast<QWidget*>(_observer));

editor.setCursorPosition(1, 4);
editor.setWindowTitle("Insert Document");
editor.setWindowTitle(tr("Insert Document"));

int result = editor.exec();
if (result != QDialog::Accepted)
Expand Down
19 changes: 11 additions & 8 deletions src/robomongo/core/domain/ScriptInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

namespace
{
const QString filterForScripts = QObject::tr("JavaScript (*.js);; All Files (*.*)");


bool loadFromFileText(const QString &filePath, QString &text)
{
bool result = false;
Expand All @@ -21,8 +20,8 @@ namespace
result = true;
}
else {
QMessageBox::critical(QApplication::activeWindow(), QString("Error"),
QObject::tr(PROJECT_NAME" can't read from %1:\n%2.")
QMessageBox::critical(QApplication::activeWindow(), qApp->translate("loadFromFileText", "Error"),
PROJECT_NAME + qApp->translate("loadFromFileText", " can't read from %1:\n%2.")
.arg(filePath)
.arg(file.errorString()));
}
Expand Down Expand Up @@ -50,8 +49,8 @@ namespace
result = true;
}
else {
QMessageBox::critical(QApplication::activeWindow(), QString("Error"),
QObject::tr(PROJECT_NAME" can't save to %1:\n%2.")
QMessageBox::critical(QApplication::activeWindow(), qApp->translate("saveToFileText", "Error"),
PROJECT_NAME + qApp->translate("saveToFileText", " can't save to %1:\n%2.")
.arg(filePath)
.arg(file.errorString()));
}
Expand All @@ -62,13 +61,17 @@ namespace

namespace Robomongo
{
QString filterForScripts;

ScriptInfo::ScriptInfo(const QString &script, bool execute,const CursorPosition &position,
const QString &title, const QString &filePath) :
_script(script),
_execute(execute),
_title(title),
_cursor(position),
_filePath(filePath) {}
_filePath(filePath) {
filterForScripts = qApp->translate("Robomongo::ScriptInfo", "JavaScript (*.js);; All Files (*.*)");
}

bool ScriptInfo::loadFromFile(const QString &filePath)
{
Expand All @@ -93,7 +96,7 @@ namespace Robomongo
bool ScriptInfo::saveToFileAs()
{
QString filepath = QFileDialog::getSaveFileName(QApplication::activeWindow(),
QObject::tr("Save As"), _filePath, filterForScripts);
qApp->translate("Robomongo::ScriptInfo", "Save As"), _filePath, filterForScripts);

if (saveToFileText(filepath,_script)) {
_filePath = filepath;
Expand Down
2 changes: 1 addition & 1 deletion src/robomongo/core/mongodb/MongoClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ namespace Robomongo
//_dbclient->save(ns.toString().toStdString(), obj);
}

void MongoClient::removeDocuments(const MongoNamespace &ns, mongo::Query query, bool justOne /*= true*/)
void MongoClient::removeDocuments(const MongoNamespace &ns, mongo::Query query, bool justOne /* = true */)
{
_dbclient->remove(ns.toString(), query, justOne);
}
Expand Down
Loading