1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 class l10nMem_enus_entry
;
23 class l10nMem_file_entry
;
24 class l10nMem_lang_list_entry
;
38 static int showError (const string
& sText
, int iLineNo
= 0);
39 static void showWarning(const string
& sText
, int iLineNo
= 0);
40 static void showDebug (const string
& sText
, int iLineNo
= 0);
41 static void showVerbose(const string
& sText
, int iLineNo
= 0);
42 static void keyToLower (string
& sKey
);
44 void setModuleName(const string
& sModuleName
);
45 const string
& getModuleName(void);
46 void setLanguage(const string
& sLanguage
,
48 void setConvert(bool bConvert
,
50 void setVerbose(const bool doVerbose
);
51 void setDebug(const bool doDebug
);
53 void loadEntryKey(int iLineNo
,
54 const string
& sSourceFile
,
56 const string
& sOrgText
,
58 const string
& sComment
,
59 const string
& sResource
,
62 void setSourceKey(int iLineNo
,
63 const string
& sFilename
,
66 const string
& sComment
,
67 const string
& sResource
,
71 void saveTemplates(const string
& sTargetDir
,
73 void saveLanguages(l10nMem
& cMem
,
74 const string
& sTargetDir
,
76 void dumpMem(const string
& sTargetDir
);
78 bool getMergeLang(string
& sLang
,
82 void convertToInetString(string
& sText
);
83 void convertFromInetString(string
& sText
);
95 vector
<l10nMem_enus_entry
> mcENUSlist
;
96 vector
<l10nMem_file_entry
> mcFileList
;
97 vector
<l10nMem_lang_list_entry
> mcLangList
;
99 void formatAndShowText(const string
& sType
, int iLineNo
, const string
& sText
);
100 bool needWrite(const string sFileName
, bool bForce
);
101 bool convFilterWarning(const string
& sSourceFile
,
103 const string
& sMsgId
);
104 void convEntryKey(int iLineNo
,
105 const string
& sSourceFile
,
107 const string
& sMsgId
,
108 const string
& sMsgStr
,
110 void loadENUSkey(int iLineNo
,
111 const string
& sSourceFile
,
113 const string
& sMsgId
,
114 const string
& sComment
,
115 const string
& sResource
,
116 const string
& sGroup
);
117 void loadLangKey(int iLineNo
,
118 const string
& sSourceFile
,
120 const string
& sMsgId
,
121 const string
& sMsgStr
,
123 void reorganize(bool bConvert
);
124 bool locateKey(int iLineNo
,
125 const string
& sSourceFile
,
127 const string
& sMsgId
,
129 void addKey(int iLineNo
,
130 const string
& sSourceFile
,
132 const string
& sMsgId
,
133 const string
& sComment
,
134 const string
& sResource
,
135 const string
& sGroup
,
136 l10nMem::ENTRY_STATE eStat
);
137 bool findFileName(const string
& sSourceFile
);