comparison src/converter.cpp @ 21:0b66b10a287d

Add german translation
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 30 Mar 2016 17:08:46 +0200
parents df7936065450
children 927794e3cc52
comparison
equal deleted inserted replaced
20:df7936065450 21:0b66b10a287d
148 xlsx.write(row++, 1, question, mQuestionFmt); 148 xlsx.write(row++, 1, question, mQuestionFmt);
149 149
150 if (answerLine == QStringLiteral(CHOICE_IDENTIFIER)) { 150 if (answerLine == QStringLiteral(CHOICE_IDENTIFIER)) {
151 QRegularExpressionMatch choiceMatch = choiceEx.match(input, cursor); 151 QRegularExpressionMatch choiceMatch = choiceEx.match(input, cursor);
152 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT); 152 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT);
153 xlsx.write(row++, 1, tr("Answer"), mAnswerChoiceFmt); 153 xlsx.write(row++, 1, "Answer", mAnswerChoiceFmt);
154 int firstChoiceRow = row; 154 int firstChoiceRow = row;
155 int lastChoiceRow = row; 155 int lastChoiceRow = row;
156 while (choiceMatch.hasMatch() && choiceMatch.capturedStart() == cursor + 1) { 156 while (choiceMatch.hasMatch() && choiceMatch.capturedStart() == cursor + 1) {
157 /* We use the cursor here to keep track of the state. Only if an answer 157 /* We use the cursor here to keep track of the state. Only if an answer
158 follows immediately behind the last answer we treat it as valid as 158 follows immediately behind the last answer we treat it as valid as
169 double percent = choiceMatch.captured(3).toDouble(&ok); 169 double percent = choiceMatch.captured(3).toDouble(&ok);
170 if (!ok) { 170 if (!ok) {
171 mErrors << "Unparsable number in string: " + choiceMatch.captured(); 171 mErrors << "Unparsable number in string: " + choiceMatch.captured();
172 } 172 }
173 xlsx.write(row, 2, percent); 173 xlsx.write(row, 2, percent);
174 xlsx.write(row, 3, tr("%1% | %2 Number of votes"). 174 xlsx.write(row, 3, QString("%1% | %2 Number of votes").
175 arg(choiceMatch.captured(3)).arg(choiceMatch.captured(2)), 175 arg(choiceMatch.captured(3)).arg(choiceMatch.captured(2)),
176 mChoiceVotesFmt); 176 mChoiceVotesFmt);
177 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT); 177 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT);
178 /* As long as we can match a choice which is either before the next question 178 /* As long as we can match a choice which is either before the next question
179 or before the end of the document */ 179 or before the end of the document */
184 bars.addRange(QString("B%1:B%2").arg(firstChoiceRow).arg(lastChoiceRow)); 184 bars.addRange(QString("B%1:B%2").arg(firstChoiceRow).arg(lastChoiceRow));
185 // xlsx.groupRows(firstChoiceRow - 2, lastChoiceRow - 1, false); 185 // xlsx.groupRows(firstChoiceRow - 2, lastChoiceRow - 1, false);
186 } else if (answerLine == QStringLiteral(TEXT_IDENTIFIER)) { 186 } else if (answerLine == QStringLiteral(TEXT_IDENTIFIER)) {
187 QRegularExpressionMatch textMatch = freetxtEx.match(input, cursor); 187 QRegularExpressionMatch textMatch = freetxtEx.match(input, cursor);
188 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT); 188 xlsx.setRowHeight(row, CHOICE_ROW_HEIGHT);
189 xlsx.write(row++, 1, tr("Answer"), mAnswerTextFmt); 189 xlsx.write(row++, 1, "Answer", mAnswerTextFmt);
190 while (textMatch.hasMatch()) { 190 while (textMatch.hasMatch()) {
191 if (textMatch.capturedStart() != cursor + 1) { 191 if (textMatch.capturedStart() != cursor + 1) {
192 /* The format allows unescaped quotes in the text. 192 /* The format allows unescaped quotes in the text.
193 This makes a workaround neccessary. If we have 193 This makes a workaround neccessary. If we have
194 an Unquoted string between the next quoted string 194 an Unquoted string between the next quoted string
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)