template.cpp   template.cpp 
skipping to change at line 247 skipping to change at line 247
void Template::enableWarnings(bool enable) void Template::enableWarnings(bool enable)
{ {
warnings=enable; warnings=enable;
} }
void Template::translate(ITemplateTranslationProvider &provider) void Template::translate(ITemplateTranslationProvider &provider)
{ {
//This regex captures expressions of the form //This regex captures expressions of the form
//<?= tr("This is a test") ?> and <?= tr("optional %1 parameters %2" ,"bla","blu") ?> //<?= tr("This is a test") ?> and <?= tr("optional %1 parameters %2" ,"bla","blu") ?>
//The first capture group is the key (untranslated string), the seco nd the optional list of parameters //The first capture group is the key (untranslated string), the seco nd the optional list of parameters
const QRegularExpression regexp = QRegularExpression("<\\?=\\s*tr\\( \"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"((?:,\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\" )*)\\s*\\)\\?>"); static const QRegularExpression regexp = QRegularExpression("<\\?=\\ s*tr\\(\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"((?:,\"[^\"\\\\]*(?:\\\\.[^\"\\\ \]*)*\")*)\\s*\\)\\?>");
//This one is used to extract the parameters using global matching //This one is used to extract the parameters using global matching
const QRegularExpression paramExp = QRegularExpression(",\"([^\"\\\\ ]*(?:\\\\.[^\"\\\\]*)*)\""); static const QRegularExpression paramExp = QRegularExpression(",\"([ ^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\"");
int offset = 0; int offset = 0;
QRegularExpressionMatch match; QRegularExpressionMatch match;
do do
{ {
match = regexp.match(*this,offset); match = regexp.match(*this,offset);
if(match.hasMatch()) if(match.hasMatch())
{ {
int start = match.capturedStart(0); int start = match.capturedStart(0);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/