1
/* ****************************************************************************
2
This file is part of KAider
3
This file is based on the one from KBabel
6
2007 by Nick Shaforostoff <shafff@ukr.net>
9
This program is free software; you can redistribute it and/or modify
10
it under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2 of the License, or
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
In addition, as a special exception, the copyright holders give
24
permission to link the code of this program with any edition of
25
the Qt library by Trolltech AS, Norway;
26
of Qt that use the same license as Qt), and distribute linked
27
combinations including the two. You must obey the GNU General
28
Public License in all respects for all of the code used other than
29
Qt. If you modify this file, you may extend this exception to
30
your version of the file, but you are not obligated to do so. If
31
you do not wish to do so, delete this exception statement from
34
**************************************************************************** */
35
#ifndef GETTEXTIMPORTPLUGIN_H
36
#define GETTEXTIMPORTPLUGIN_H
38
#include "catalogfileplugin.h"
42
#include <QStringList>
43
#include <QTextStream>
47
/* ****************************************************************************
48
The class for importing GNU gettext PO files. As an extra information,
49
it stores the list of all obsolete entries.
50
**************************************************************************** */
52
class GettextImportPlugin: public CatalogImportPlugin
55
GettextImportPlugin();
56
virtual ConversionStatus load(const QString& file);
57
virtual const QString id() {return "GNU gettext";}
60
QTextCodec* codecForArray(QByteArray&/*, bool* hadCodec*/);
61
ConversionStatus readHeader(QTextStream& stream);
62
ConversionStatus readEntry(QTextStream& stream);
64
// description of the last read entry
69
bool _gettextPluralForm;
75
QRegExp _rxMsgIdPlural;
76
QRegExp _rxMsgIdPluralBorked;
77
QRegExp _rxMsgIdBorked;
78
QRegExp _rxMsgIdRemQuotes;
79
QRegExp _rxMsgLineRemEndQuote;
80
QRegExp _rxMsgLineRemStartQuote;
82
QRegExp _rxMsgLineBorked;
84
QRegExp _rxMsgStrOther;
85
QRegExp _rxMsgStrPluralStart;
86
QRegExp _rxMsgStrPluralStartBorked;
87
QRegExp _rxMsgStrPlural;
88
QRegExp _rxMsgStrPluralBorked;
89
QRegExp _rxMsgStrRemQuotes;
91
QString _obsoleteStart;
92
QString _msgctxtStart;