change: force gcc use english to output if not in zh locale
enhancement: support gcc zh_CN locale
This commit is contained in:
parent
1283609c41
commit
cb323850f0
|
@ -179,6 +179,15 @@ CompileIssueType Compiler::getIssueTypeFromOutputLine(QString &line)
|
|||
{
|
||||
CompileIssueType result = CompileIssueType::Other;
|
||||
line = line.trimmed();
|
||||
if (line.startsWith(tr("error:"))) {
|
||||
mErrorCount += 1;
|
||||
line = tr("[Error] ")+line.mid(tr("error:").length());
|
||||
result = CompileIssueType::Error;
|
||||
} else if (line.startsWith(tr("warning:"))) {
|
||||
mWarningCount += 1;
|
||||
line = tr("[Warning] ")+line.mid(tr("warning:").length());
|
||||
result = CompileIssueType::Warning;
|
||||
} else {
|
||||
int pos = line.indexOf(':');
|
||||
if (pos>=0) {
|
||||
QString s=line.mid(0,pos);
|
||||
|
@ -187,20 +196,25 @@ CompileIssueType Compiler::getIssueTypeFromOutputLine(QString &line)
|
|||
mErrorCount += 1;
|
||||
line = tr("[Error] ")+line.mid(pos+1);
|
||||
result = CompileIssueType::Error;
|
||||
} else if (s.startsWith("warning")) {
|
||||
} else if (s.startsWith("warning")
|
||||
|| s.startsWith(tr("warning"))) {
|
||||
mWarningCount += 1;
|
||||
line = tr("[Warning] ")+line.mid(pos+1);
|
||||
result = CompileIssueType::Warning;
|
||||
} else if (s == "info") {
|
||||
} else if (s == "info"
|
||||
|| s == tr("info")) {
|
||||
mWarningCount += 1;
|
||||
line = tr("[Info] ")+line.mid(pos+1);
|
||||
result = CompileIssueType::Info;
|
||||
} else if (s == "note") {
|
||||
} else if (s == "note"
|
||||
|| s == tr("note")) {
|
||||
mWarningCount += 1;
|
||||
line = tr("[Note] ")+line.mid(pos+1);
|
||||
result = CompileIssueType::Note;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -3747,7 +3747,8 @@ Settings::PCompilerSet Settings::CompilerSets::loadSet(int index)
|
|||
pSet->setAutoAddCharsetParams(mSettings->mSettings.value("AddCharset", true).toBool());
|
||||
pSet->setStaticLink(mSettings->mSettings.value("StaticLink", false).toBool());
|
||||
pSet->setPersistInAutoFind(mSettings->mSettings.value("PersistInAutoFind", false).toBool());
|
||||
pSet->setForceEnglishOutput(mSettings->mSettings.value("forceEnglishOutput", false).toBool());
|
||||
bool forceEnglishOutput=QLocale::system().name().startsWith("zh")?false:true;
|
||||
pSet->setForceEnglishOutput(mSettings->mSettings.value("forceEnglishOutput", forceEnglishOutput).toBool());
|
||||
|
||||
pSet->setExecCharset(mSettings->mSettings.value("ExecCharset", ENCODING_SYSTEM_DEFAULT).toString());
|
||||
if (pSet->execCharset().isEmpty()) {
|
||||
|
|
|
@ -499,6 +499,34 @@
|
|||
<source> - Command: %1 > %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>warning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>note</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fatal error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>syntax error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>warning:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CompilerAutolinkWidget</name>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -400,6 +400,34 @@
|
|||
<source> - Command: %1 > %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>warning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>info</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>note</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>fatal error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>syntax error:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>warning:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>CompilerAutolinkWidget</name>
|
||||
|
|
Loading…
Reference in New Issue