Skip to content

Commit

Permalink
Replaced QObject::tr() with tr() wherever possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Jul 13, 2017
1 parent 32be527 commit ec05793
Show file tree
Hide file tree
Showing 62 changed files with 431 additions and 345 deletions.
19 changes: 11 additions & 8 deletions i18n/OpenCOR_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@
<translation>Aucune nouvelle version d&apos;%1 n&apos;est disponible.</translation>
</message>
</context>
<context>
<name>OpenCOR::CheckForUpdatesEngine</name>
<message>
<source>The version information is mal-formatted.</source>
<translation>Les informations sur la version sont mal formatées.</translation>
</message>
<message>
<source>Please &lt;a href=&quot;http://opencor.ws/user/contactUs.html&quot;&gt;contact us&lt;/a&gt; about this error.</source>
<translation>Veuillez &lt;a href=&quot;http://opencor.ws/user/contactUs.html&quot;&gt;nous contacter&lt;/a&gt; au sujet de cette erreur.</translation>
</message>
</context>
<context>
<name>OpenCOR::MainWindow</name>
<message>
Expand Down Expand Up @@ -351,14 +362,6 @@
</context>
<context>
<name>QObject</name>
<message>
<source>The version information is mal-formatted.</source>
<translation>Les informations sur la version sont mal formatées.</translation>
</message>
<message>
<source>Please &lt;a href=&quot;http://opencor.ws/user/contactUs.html&quot;&gt;contact us&lt;/a&gt; about this error.</source>
<translation>Veuillez &lt;a href=&quot;http://opencor.ws/user/contactUs.html&quot;&gt;nous contacter&lt;/a&gt; au sujet de cette erreur.</translation>
</message>
<message>
<source>%1 is a cross-platform modelling environment, which can be used to organise, edit, simulate and analyse &lt;a href=&quot;http://www.cellml.org/&quot;&gt;CellML&lt;/a&gt; files.</source>
<translation>%1 est un environnement de modélisation multiplate-forme, qui peut être utilisé pour organiser, éditer, simuler et analyser des fichiers &lt;a href=&quot;http://www.cellml.org/&quot;&gt;CellML&lt;/a&gt;.</translation>
Expand Down
4 changes: 2 additions & 2 deletions src/checkforupdatesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ void CheckForUpdatesEngine::check()

mStatus = QString();
} else {
mStatus = QObject::tr("The version information is mal-formatted.")
mStatus = tr("The version information is mal-formatted.")
+"<br/>"
+QObject::tr("Please <a href=\"http://opencor.ws/user/contactUs.html\">contact us</a> about this error.");
+tr("Please <a href=\"http://opencor.ws/user/contactUs.html\">contact us</a> about this error.");
}
} else {
mStatus = formatMessage(errorMessage, false, true);
Expand Down
4 changes: 3 additions & 1 deletion src/checkforupdatesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ static const auto SettingsIncludeSnapshots = QStringLiteral("IncludeSnap

//==============================================================================

class CheckForUpdatesEngine
class CheckForUpdatesEngine : public QObject
{
Q_OBJECT

public:
explicit CheckForUpdatesEngine(const QString &pApplicationDate);

Expand Down
1 change: 1 addition & 0 deletions src/plugins/dataStore/BioSignalMLDataStore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ADD_PLUGIN(BioSignalMLDataStore
../../datastoreinterface.h

src/biosignalmldatastoredialog.h
src/biosignalmldatastoreexporter.h
src/biosignalmldatastoreplugin.h
PLUGINS
BioSignalMLAPI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR" sourcelanguage="en_GB">
<context>
<name>OpenCOR::BioSignalMLDataStore::BioSignalMLDataStorePlugin</name>
<message>
<source>BioSignalML File</source>
<translation>Fichier BioSignalML</translation>
</message>
<message>
<source>Export To BioSignalML</source>
<translation>Exporter Vers BioSignalML</translation>
</message>
<message>
<source>Data</source>
<translation>Données</translation>
</message>
<message>
<source>Generated by %1 at %2 from %3.</source>
<translation>Généré par %1 à %2 à partir de %3.</translation>
</message>
</context>
<context>
<name>OpenCOR::BioSignalMLDataStore::BiosignalmlDataStoreDialog</name>
<message>
Expand All @@ -21,26 +40,10 @@
</message>
</context>
<context>
<name>QObject</name>
<name>OpenCOR::BioSignalMLDataStore::BiosignalmlDataStoreExporter</name>
<message>
<source>The data could not be exported to BioSignalML (%1).</source>
<translation>Les données n&apos;ont pas pu être exportées vers BioSignalML (%1).</translation>
</message>
<message>
<source>BioSignalML File</source>
<translation>Fichier BioSignalML</translation>
</message>
<message>
<source>Export To BioSignalML</source>
<translation>Exporter Vers BioSignalML</translation>
</message>
<message>
<source>Data</source>
<translation>Données</translation>
</message>
<message>
<source>Generated by %1 at %2 from %3.</source>
<translation>Généré par %1 à %2 à partir de %3.</translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void BiosignalmlDataStoreExporter::execute(QString &pErrorMessage) const
// Something went wrong, so retrieve the error message and delete our
// BioSignalML file

pErrorMessage = QObject::tr("The data could not be exported to BioSignalML (%1).").arg(e.what());
pErrorMessage = tr("The data could not be exported to BioSignalML (%1).").arg(e.what());

QFile::remove(fileName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace BioSignalMLDataStore {

class BiosignalmlDataStoreExporter : public DataStore::DataStoreExporter
{
Q_OBJECT

public:
explicit BiosignalmlDataStoreExporter(const QString &pFileName,
DataStore::DataStore *pDataStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ DataStore::DataStoreData * BioSignalMLDataStorePlugin::getData(const QString &pF
// Now that we have the information we need, we can ask for the name of
// the BioSignalML file where to do the export

QString biosignalmlFilter = QObject::tr("BioSignalML File")+" (*.biosignalml)";
QString fileName = Core::getSaveFileName(QObject::tr("Export To BioSignalML"),
Core::newFileName(pFileName, QObject::tr("Data"), false, "biosignalml"),
QString biosignalmlFilter = tr("BioSignalML File")+" (*.biosignalml)";
QString fileName = Core::getSaveFileName(tr("Export To BioSignalML"),
Core::newFileName(pFileName, tr("Data"), false, "biosignalml"),
QStringList() << biosignalmlFilter,
&biosignalmlFilter);

Expand All @@ -101,9 +101,9 @@ DataStore::DataStoreData * BioSignalMLDataStorePlugin::getData(const QString &pF
biosignalmlDataStoreDialog.name(),
biosignalmlDataStoreDialog.author(),
biosignalmlDataStoreDialog.description(),
QObject::tr("Generated by %1 at %2 from %3.").arg(Core::version(),
QDateTime::currentDateTimeUtc().toString(Qt::ISODate),
pDataStore->uri()),
tr("Generated by %1 at %2 from %3.").arg(Core::version(),
QDateTime::currentDateTimeUtc().toString(Qt::ISODate),
pDataStore->uri()),
biosignalmlDataStoreDialog.selectedData());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dataStore/CSVDataStore/i18n/CSVDataStore_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR" sourcelanguage="en_GB">
<context>
<name>QObject</name>
<name>OpenCOR::CSVDataStore::CSVDataStorePlugin</name>
<message>
<source>CSV File</source>
<translation>Fichier CSV</translation>
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/dataStore/CSVDataStore/src/csvdatastoreplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ DataStore::DataStoreData * CSVDataStorePlugin::getData(const QString &pFileName,
// Now that we know which data to export, we can ask for the name of the
// CSV file where it is to be exported

QString csvFilter = QObject::tr("CSV File")+" (*.csv)";
QString fileName = Core::getSaveFileName(QObject::tr("Export To CSV"),
Core::newFileName(pFileName, QObject::tr("Data"), false, "csv"),
QString csvFilter = tr("CSV File")+" (*.csv)";
QString fileName = Core::getSaveFileName(tr("Export To CSV"),
Core::newFileName(pFileName, tr("Data"), false, "csv"),
QStringList() << csvFilter,
&csvFilter);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
<translation>Annotation CellML</translation>
</message>
</context>
<context>
<name>OpenCOR::CellMLAnnotationView::CellmlAnnotationViewCellmlElementItem</name>
<message>
<source>Group #%1</source>
<translation>Groupe n° %1</translation>
</message>
<message>
<source>Connection #%1</source>
<translation>Connexion n° %1</translation>
</message>
</context>
<context>
<name>OpenCOR::CellMLAnnotationView::CellmlAnnotationViewCellmlListWidget</name>
<message>
Expand Down Expand Up @@ -410,15 +421,4 @@
<translation>Objet</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Group #%1</source>
<translation>Groupe n° %1</translation>
</message>
<message>
<source>Connection #%1</source>
<translation>Connexion n° %1</translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(con

break;
case Group:
setText(QObject::tr("Group #%1").arg(pNumber));
setText(tr("Group #%1").arg(pNumber));

break;
case RelationshipReference: {
Expand All @@ -175,7 +175,7 @@ CellmlAnnotationViewCellmlElementItem::CellmlAnnotationViewCellmlElementItem(con

break;
case Connection:
setText(QObject::tr("Connection #%1").arg(pNumber));
setText(tr("Connection #%1").arg(pNumber));

break;
case ComponentMapping: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ class CellmlAnnotationViewCellmlElementItemDelegate : public QStyledItemDelegate

//==============================================================================

class CellmlAnnotationViewCellmlElementItem : public QStandardItem
class CellmlAnnotationViewCellmlElementItem : public QObject,
public QStandardItem
{
Q_OBJECT

public:
enum Type {
Error = QStandardItem::UserType,
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/editing/CellMLTextView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ ADD_PLUGIN(CellMLTextView
src/cellmltextviewscanner.cpp
src/cellmltextviewwidget.cpp
HEADERS_MOC
src/cellmltextviewconverter.h
src/cellmltextviewparser.h
src/cellmltextviewplugin.h
src/cellmltextviewscanner.h
src/cellmltextviewwidget.h
PLUGINS
CellMLEditingView
Expand Down
Loading

0 comments on commit ec05793

Please sign in to comment.