Changeset View
Changeset View
Standalone View
Standalone View
src/catalog/gettext/gettextstorage.cpp
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | |||||
172 | QString GettextStorage::source(const DocPosition& pos) const | 172 | QString GettextStorage::source(const DocPosition& pos) const | ||
173 | { | 173 | { | ||
174 | return m_entries.at(pos.entry).msgid(pos.form); | 174 | return m_entries.at(pos.entry).msgid(pos.form); | ||
175 | } | 175 | } | ||
176 | QString GettextStorage::target(const DocPosition& pos) const | 176 | QString GettextStorage::target(const DocPosition& pos) const | ||
177 | { | 177 | { | ||
178 | return m_entries.at(pos.entry).msgstr(pos.form); | 178 | return m_entries.at(pos.entry).msgstr(pos.form); | ||
179 | } | 179 | } | ||
180 | QString GettextStorage::sourceWithPlurals(const DocPosition& pos) const | ||||
181 | { | ||||
182 | if (m_entries.at(pos.entry).isPlural()) { | ||||
183 | const QVector<QString> plurals = m_entries.at(pos.entry).msgidPlural(); | ||||
184 | QString pluralString = QString(); | ||||
185 | for (int i = 0; i < plurals.size(); i++) { | ||||
186 | pluralString += plurals.at(i); | ||||
187 | if (i != plurals.size() - 1) { | ||||
188 | pluralString += "|"; | ||||
189 | } | ||||
190 | } | ||||
191 | return pluralString; | ||||
192 | } else { | ||||
193 | return m_entries.at(pos.entry).msgid(pos.form); | ||||
194 | } | ||||
195 | } | ||||
196 | QString GettextStorage::targetWithPlurals(const DocPosition& pos) const | ||||
197 | { | ||||
198 | if (m_entries.at(pos.entry).isPlural()) { | ||||
199 | const QVector<QString> plurals = m_entries.at(pos.entry).msgstrPlural(); | ||||
200 | QString pluralString = QString(); | ||||
201 | for (int i = 0; i < plurals.size(); i++) { | ||||
202 | pluralString += plurals.at(i); | ||||
203 | if (i != plurals.size() - 1) { | ||||
204 | pluralString += "|"; | ||||
205 | } | ||||
206 | } | ||||
207 | return pluralString; | ||||
208 | } else { | ||||
209 | return m_entries.at(pos.entry).msgstr(pos.form); | ||||
210 | } | ||||
211 | } | ||||
180 | 212 | | |||
181 | void GettextStorage::targetDelete(const DocPosition& pos, int count) | 213 | void GettextStorage::targetDelete(const DocPosition& pos, int count) | ||
182 | { | 214 | { | ||
183 | m_entries[pos.entry].d._msgstrPlural[pos.form].remove(pos.offset, count); | 215 | m_entries[pos.entry].d._msgstrPlural[pos.form].remove(pos.offset, count); | ||
184 | } | 216 | } | ||
185 | void GettextStorage::targetInsert(const DocPosition& pos, const QString& arg) | 217 | void GettextStorage::targetInsert(const DocPosition& pos, const QString& arg) | ||
186 | { | 218 | { | ||
187 | m_entries[pos.entry].d._msgstrPlural[pos.form].insert(pos.offset, arg); | 219 | m_entries[pos.entry].d._msgstrPlural[pos.form].insert(pos.offset, arg); | ||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |