Skip to content

Commit

Permalink
translate more strings
Browse files Browse the repository at this point in the history
update german translation
  • Loading branch information
hkiel committed Jun 2, 2017
1 parent 2b12dca commit d0aa5e6
Show file tree
Hide file tree
Showing 15 changed files with 707 additions and 436 deletions.
928 changes: 606 additions & 322 deletions OMNotebook/OMNotebookGUI/Resources/nls/OMNotebook_de_DE.ts

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions OMNotebook/OMNotebookGUI/cellapplication.cpp
Expand Up @@ -120,7 +120,7 @@ namespace IAEX
const char *omhome = getenv("OPENMODELICAHOME");
#ifdef WIN32
if (!omhome) {
QMessageBox::critical(0, "OMNotebook", "OPENMODELICAHOME not set", "OK");
QMessageBox::critical(0, tr("Error"), tr("OPENMODELICAHOME not set"), "OK");
app_->quit();
exit(1);
}
Expand Down Expand Up @@ -156,7 +156,7 @@ namespace IAEX

if(!QDir().exists(openmodelica))
{
QMessageBox::critical( 0, "OpenModelica Error", "The environment variable OPENMODELICAHOME="+openmodelica+" is not a valid directory" );
QMessageBox::critical( 0, "OpenModelica Error", tr("The environment variable OPENMODELICAHOME=%1 is not a valid directory").arg(openmodelica) );
exit(1);
}

Expand All @@ -174,7 +174,7 @@ namespace IAEX
QString cdRes = env->getResult();
cdRes.remove("\"");
if (0 != tmpDir.compare(cdRes)) {
QMessageBox::critical( 0, "OpenModelica Error", "Could not create or cd to temp-dir\nCommand:\n "+tmpDir+"\nReturned:\n "+cdRes);
QMessageBox::critical( 0, "OpenModelica Error", tr("Could not create or cd to temp-dir\nCommand:\n %1\nReturned:\n %2").arg(tmpDir).arg(cdRes));
exit(1);
}

Expand All @@ -192,7 +192,7 @@ namespace IAEX
}
catch( exception &e )
{
QMessageBox::warning( 0, "Error", e.what(), "OK" );
QMessageBox::warning( 0, tr("Error"), e.what(), "OK" );
exit(-1);
}

Expand All @@ -212,7 +212,7 @@ namespace IAEX
{
QString msg = e.what();
msg += "\nCould not create command completion class, exiting OMNotebook";
QMessageBox::warning( 0, "Error", msg, "OK" );
QMessageBox::warning( 0, tr("Error"), msg, "OK" );
std::exit(-1);
}

Expand Down Expand Up @@ -311,8 +311,7 @@ namespace IAEX
{
if( !dir.remove( removeList_.at(i) ))
{
QString msg = "Could not remove temporary image " + removeList_.at(i) + " from harddrive.";
QMessageBox::warning( 0, "Warning", msg, "OK" );
QMessageBox::warning( 0, tr("Warning"), tr("Could not remove temporary image %1 from harddrive.").arg(removeList_.at(i)), "OK" );
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions OMNotebook/OMNotebookGUI/cellcommandcenter.cpp
Expand Up @@ -36,6 +36,7 @@

//QT Headers
#include <QtGlobal>
#include <QObject>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtWidgets>
#else
Expand Down Expand Up @@ -86,13 +87,11 @@ namespace IAEX

if( 0 <= msg.indexOf( "OpenFileCommand()", 0, Qt::CaseInsensitive ))
{
msg += QString("\r\n\r\nIf you are trying to open an old ") +
QString("OMNotebook file, use menu 'File->Import->") +
QString("Old OMNotebook file' instead.");
msg += QString("\r\n\r\n")+QObject::tr("If you are trying to open an old OMNotebook file, use menu 'File->Import->Old OMNotebook file' instead.");
}

// display message box
QMessageBox::warning( 0, "Warning", msg, "OK" );
QMessageBox::warning( 0, QObject::tr("Warning"), msg, "OK" );
}
}

Expand All @@ -118,4 +117,3 @@ namespace IAEX
}
}
}

3 changes: 2 additions & 1 deletion OMNotebook/OMNotebookGUI/cellcommands.cpp
Expand Up @@ -38,6 +38,7 @@
*/

// QT Headers
#include <QObject>
#include <QtGui/QTextCursor>
#include <QtGui/QTextDocumentFragment>

Expand Down Expand Up @@ -311,7 +312,7 @@ namespace IAEX
}
else
{
QMessageBox::warning( 0, "Warning", "No Cells Copied to paste, To paste a cell, select the cells and perform copy", "OK" );
QMessageBox::warning( 0, QObject::tr("Warning"), QObject::tr("No cells in clipboard. To paste a cell, select the cells and perform copy."), "OK" );
}

//2006-01-18 AF, set docuement changed
Expand Down
6 changes: 3 additions & 3 deletions OMNotebook/OMNotebookGUI/celldocument.cpp
Expand Up @@ -393,11 +393,11 @@ namespace IAEX
void CellDocument::cursorDeleteCell()
{
executeCommand(new DeleteSelectedCellsCommand());
qDebug("cursorDeleteCell");
//qDebug("cursorDeleteCell");

//emit cursorChanged(); //This causes an untracable segfault.

qDebug("Finished");
//qDebug("Finished");
}

/*!
Expand Down Expand Up @@ -666,7 +666,7 @@ namespace IAEX

// save the image temporary to the harddrive
QImageWriter writer( name, "png" );
writer.setDescription( "Temporary OMNotebook image" );
writer.setDescription( tr("Temporary OMNotebook image") );
writer.setQuality( 100 );
writer.write( *image );

Expand Down
10 changes: 5 additions & 5 deletions OMNotebook/OMNotebookGUI/cellfactory.cpp
Expand Up @@ -114,7 +114,7 @@ namespace IAEX
}
catch( exception e )
{
QMessageBox::warning( 0, "Warning", e.what(), "OK" );
QMessageBox::warning( 0, QObject::tr("Warning"), e.what(), "OK" );
}

try
Expand Down Expand Up @@ -196,12 +196,12 @@ namespace IAEX

text->setStyle( cstyle );
else
throw runtime_error("No Input style defened, the inputcell may not work correctly, please define a Input style in stylesheet.xml");
throw runtime_error("No Input style defined, the inputcell may not work correctly, please define an Input style in stylesheet.xml");
}
catch( exception e )
{

QMessageBox::warning( 0, "Warrning", e.what(), "OK" );
QMessageBox::warning( 0, QObject::tr("Warning"), e.what(), "OK" );
}

QObject::connect(text, SIGNAL(cellselected(Cell *,Qt::KeyboardModifiers)),
Expand Down Expand Up @@ -260,11 +260,11 @@ namespace IAEX
if( cstyle.name() != "null" )
text->setStyle( cstyle );
else
throw runtime_error("No Input style defened, the inputcell may not work correctly, please define a Input style in stylesheet.xml");
throw runtime_error("No Input style defined, the inputcell may not work correctly, please define an Input style in stylesheet.xml");
}
catch( exception e )
{
QMessageBox::warning( 0, "Warrning", e.what(), "OK" );
QMessageBox::warning( 0, QObject::tr("Warning"), e.what(), "OK" );
}

try
Expand Down
13 changes: 12 additions & 1 deletion OMNotebook/OMNotebookGUI/commands.xml
Expand Up @@ -255,6 +255,9 @@
<field name="$0">BaseClass</field>
<helptext>Extends existing class (inheritance).</helptext>
</element>
<element name="initial equation"></element>
<element name="initial algorithm"></element>
<element name="initial()"></element>
<element name="input"></element>
<element name="ouput"></element>
<element name="flow"></element>
Expand All @@ -270,5 +273,13 @@
<field name="$0">cond</field>
<helptext>Suppresses generation of events.</helptext>
</element>

<element name="for $0 in $1 loop">
<field name="$0">element</field>
<field name="$1">expression</field>
<helptext>Iterate over elements.</helptext>
</element>
<element name="while $0 loop">
<field name="$0">cond</field>
<helptext>While-statement.</helptext>
</element>
</commands>
25 changes: 14 additions & 11 deletions OMNotebook/OMNotebookGUI/graphcell.cpp
Expand Up @@ -523,7 +523,7 @@ namespace IAEX {
input_ = new MyTextEdit2( mainWidget() );
mpModelicaTextHighlighter = new ModelicaTextHighlighter(input_->document());
variableButton = new QPushButton("D",input_);
variableButton->setToolTip("New simulation data available");
variableButton->setToolTip(tr("New simulation data available"));

variableButton->setMaximumWidth(25);
layout_->addWidget( input_, 1, 1 );
Expand Down Expand Up @@ -637,8 +637,8 @@ namespace IAEX {

int MyTextEdit2::indentationLevel(QString s, bool includeNegative)
{
QRegExp e1("\\b(model|class|type|connector|block|record|function|record|for|when|package|if)\\b");
QRegExp e1b("end\\s+(model|class|type|connector|block|record|function|record|for|when|package|if)\\b");
QRegExp e1("\\b(model|class|type|connector|block|record|function|for|when|package|if)\\b");
QRegExp e1b("end\\s+(model|class|type|connector|block|record|function|for|when|package|if)\\b");
QRegExp e2("\\b(end|then)\\b");

QRegExp newLineEnd("^end\\b");
Expand Down Expand Up @@ -686,8 +686,7 @@ namespace IAEX {
else
{
// 2006-01-30 AF, add message box
QString msg = "No Output style defened, please define a Output style in stylesheet.xml";
QMessageBox::warning( 0, "Warning", msg, "OK" );
QMessageBox::warning( 0, tr("Warning"), tr("No Output style defined, please define an Output style in stylesheet.xml"), "OK" );
}

QTextCursor cursor = output_->textCursor();
Expand Down Expand Up @@ -1304,7 +1303,7 @@ namespace IAEX {
}
catch (PlotException &e)
{
QMessageBox::warning( 0, "Error", e.what(), "OK" );
QMessageBox::warning( 0, tr("Error"), e.what(), "OK" );
}
}

Expand Down Expand Up @@ -1415,15 +1414,17 @@ namespace IAEX {
else
setState(Finished);

#if 0
QRegExp e("([\\d]+:[\\d]+-[\\d]+:[\\d]+)|([\\d]+:[\\d]+)");

// bool b;
int p=0;
#endif

output_->selectAll();
output_->textCursor().insertText( res );

QPalette pal = output_->palette(); // define pallete for textEdit..
QPalette pal = output_->palette(); // define palette for textEdit.
if (errorLevel >= 2) {
pal.setColor(QPalette::Base, QColor(0xff,0xe0,0xe0));
} else if (errorLevel == 1) {
Expand All @@ -1433,6 +1434,7 @@ namespace IAEX {
}
output_->setPalette(pal);

#if 0
QList<QAction*> actions;
while((p=res.indexOf(e, p)) > 0)
{
Expand Down Expand Up @@ -1477,6 +1479,7 @@ namespace IAEX {
}
}
emit setStatusMenu(actions);
#endif

++numEvals_;
contentChanged();
Expand All @@ -1498,16 +1501,16 @@ namespace IAEX {
switch(state_)
{
case Modified:
emit newState("Ready");
emit newState(tr("Ready"));
break;
case Eval:
emit newState("Evaluating...");
emit newState(tr("Evaluating..."));
break;
case Finished:
emit newState("Done");
emit newState(tr("Done"));
break;
case Error:
emit newState("Error");
emit newState(tr("Error"));
break;
}
}
Expand Down
11 changes: 2 additions & 9 deletions OMNotebook/OMNotebookGUI/indent.cpp
Expand Up @@ -451,8 +451,6 @@ QString Indent::indentedText(QMap<int, IndentationState*>* states)
else
res = res + "\n" + QString(2*ism.level -2*ism.lMod, ' ') +tmp + current.trimmed() + QString(newline-1, '\n'); //QString(tmp.size()?1:0, ' ') + current.trimmed();
// res = res + "\n" + QString(2*ism.level -2*ism.lMod, ' ') +tmp + current.trimmed() + QString(comment.size()?1:0,'\n') + QString(newline-1, '\n'); //QString(tmp.size()?1:0, ' ') + current.trimmed();


// res = res + "\n" + QString(2*4 -2*2, '#') + tmp + QString(tmp.size()?0:1, ' ') + current;
comment = "";
tmp = "";
Expand All @@ -470,14 +468,9 @@ QString Indent::indentedText(QMap<int, IndentationState*>* states)
(*states)[N] = new IndentationState(ism.state, ism.level, ism.nextMod, current, next, ism.skipNext, ism.lMod, ism.equation, ism.equationSection, ism.loopBlock);
}
}
else
else {
tmp += current.trimmed() + QString(current.size()?1:0, ' ') ;


}
}



return res.trimmed();

}
6 changes: 2 additions & 4 deletions OMNotebook/OMNotebookGUI/inputcell.cpp
Expand Up @@ -473,8 +473,7 @@ namespace IAEX
else
{
// 2006-01-30 AF, add message box
QString msg = "No Output style defened, please define a Output style in stylesheet.xml";
QMessageBox::warning( 0, "Warning", msg, "OK" );
QMessageBox::warning( 0, tr("Warning"), tr("No Output style defined, please define an Output style in stylesheet.xml"), "OK" );
}

QTextCursor cursor = output_->textCursor();
Expand Down Expand Up @@ -1074,9 +1073,8 @@ namespace IAEX
// 2006-02-17 AF, set text '{evaluation expression}" during
// evaluation of expressiuon
output_->selectAll();
output_->textCursor().insertText( "{evaluating expression}" );
output_->textCursor().insertText( tr("{evaluating expression}") );
setOutputStyle();
//output_->setPlainText( "{evaluating expression}" );
output_->update();
QCoreApplication::processEvents();
delegate()->evalExpression(expr);
Expand Down
21 changes: 10 additions & 11 deletions OMNotebook/OMNotebookGUI/latexcell.cpp
Expand Up @@ -509,8 +509,8 @@ namespace IAEX {

int MyTextEdit3::indentationLevel(QString s, bool includeNegative)
{
QRegExp e1("\\b(model|class|type|connector|block|record|function|record|for|when|package|if)\\b");
QRegExp e1b("end\\s+(model|class|type|connector|block|record|function|record|for|when|package|if)\\b");
QRegExp e1("\\b(model|class|type|connector|block|record|function|for|when|package|if)\\b");
QRegExp e1b("end\\s+(model|class|type|connector|block|record|function|for|when|package|if)\\b");
QRegExp e2("\\b(end|then)\\b");

QRegExp newLineEnd("^end\\b");
Expand Down Expand Up @@ -558,8 +558,7 @@ namespace IAEX {
else
{
// 2006-01-30 AF, add message box
QString msg = "No Output style defened, please define a Output style in stylesheet.xml";
QMessageBox::warning( 0, "Warning", msg, "OK" );
QMessageBox::warning( 0, tr("Warning"), tr("No Output style defined, please define an Output style in stylesheet.xml"), "OK" );
}

QTextCursor cursor = output_->textCursor();
Expand Down Expand Up @@ -1102,7 +1101,7 @@ void LatexCell::eval(bool silent)
if (Latexversion.isEmpty())
{
if (!silent)
QMessageBox::warning( 0, "Error", "Latex is not installed in your System. This cell cannot be evaluated.", "OK" );
QMessageBox::warning( 0, tr("Error"), tr("Latex is not installed in your System. This cell cannot be evaluated."), "OK" );
}
/*Generate the DVI file from tex through latex */
else
Expand Down Expand Up @@ -1168,15 +1167,15 @@ void LatexCell::eval(bool silent)
else
{

QMessageBox::warning( 0, "Warning", "Maximum of 1 page document generation is supported per Latexcell, The script generates more than 1 page", "OK" );
QMessageBox::warning( 0, tr("Warning"), tr("Maximum of 1 page document generation is supported per Latexcell.\nThe script generates more than 1 page."), "OK" );
}
}
}
else
{
//qDebug()<< "Empty cells can't be evaluated";
input_->clear();
input_->textCursor().insertText("Message: Empty Latex Cells cannot be Evaluated");
input_->textCursor().insertText(tr("Message: Empty Latex Cells cannot be evaluated."));
setClosed(false);
}
input_->blockSignals(false);
Expand All @@ -1190,16 +1189,16 @@ void LatexCell::setState(int state_)
switch(state_)
{
case Modified_l:
emit newState("Ready");
emit newState(tr("Ready"));
break;
case Eval_l:
emit newState("Evaluating...");
emit newState(tr("Evaluating..."));
break;
case Finished_l:
emit newState("Done");
emit newState(tr("Done"));
break;
case Error_l:
emit newState("Error");
emit newState(tr("Error"));
break;
}
}
Expand Down

0 comments on commit d0aa5e6

Please sign in to comment.