Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1139c76b
Kaydet (Commit)
1139c76b
authored
Eyl 30, 2018
tarafından
Andras Timar
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pocheck: tdf#119080 update po checker tool for post LO 6.0 po files
Change-Id: I700eaa0d412fb609fdc89ca07003534e6bb13854
üst
2a47dd07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
101 deletions
+16
-101
pocheck.cxx
l10ntools/source/pocheck.cxx
+16
-101
No files found.
l10ntools/source/pocheck.cxx
Dosyayı görüntüle @
1139c76b
...
...
@@ -24,7 +24,7 @@ static void checkStyleNames(const OString& aLanguage)
OString
aPoPath
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/sw/
source/ui/utlui
.po"
;
aLanguage
+
"/sw/
messages
.po"
;
PoIfstream
aPoInput
;
aPoInput
.
open
(
aPoPath
);
if
(
!
aPoInput
.
isOpen
()
)
...
...
@@ -43,8 +43,7 @@ static void checkStyleNames(const OString& aLanguage)
break
;
}
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getSourceFile
()
==
"poolfmt.src"
&&
aPoEntry
.
getGroupId
().
startsWith
(
"STR_POOLCOLL"
)
)
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getMsgCtxt
().
startsWith
(
"STR_POOLCOLL"
)
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
...
...
@@ -56,8 +55,7 @@ static void checkStyleNames(const OString& aLanguage)
bRepeated
=
true
;
}
}
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getSourceFile
()
==
"poolfmt.src"
&&
aPoEntry
.
getGroupId
().
startsWith
(
"STR_POOLNUMRULE"
)
)
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getMsgCtxt
().
startsWith
(
"STR_POOLNUMRULE"
)
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
...
...
@@ -100,7 +98,7 @@ static void checkStyleNames(const OString& aLanguage)
}
PoOfstream
aPoOutput
;
aPoOutput
.
open
(
aPoPath
+
".new"
);
PoHeader
aTmp
(
"sw/
source/ui/utlui
"
);
PoHeader
aTmp
(
"sw/
inc
"
);
aPoOutput
.
writeHeader
(
aTmp
);
bool
bAnyError
=
false
;
...
...
@@ -113,7 +111,7 @@ static void checkStyleNames(const OString& aLanguage)
break
;
for
(
auto
const
&
repeatedEntry
:
repeatedEntries
)
{
if
(
repeatedEntry
.
getMsgId
()
==
aPoEntry
.
getMsgId
()
&&
repeatedEntry
.
get
GroupId
()
==
aPoEntry
.
getGroupId
())
{
if
(
repeatedEntry
.
getMsgId
()
==
aPoEntry
.
getMsgId
()
&&
repeatedEntry
.
get
MsgCtxt
()
==
aPoEntry
.
getMsgCtxt
())
{
bError
=
true
;
break
;
}
...
...
@@ -142,13 +140,13 @@ static void checkFunctionNames(const OString& aLanguage)
std
::
vector
<
PoEntry
>
repeatedEntries
;
OString
aPoPaths
[
4
];
OString
aPoPaths
[
2
];
OUString
aPoPathURL
;
aPoPaths
[
0
]
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/formula/
source/core/resource
.po"
;
"/formula/
messages
.po"
;
PoIfstream
aPoInput
;
aPoInput
.
open
(
aPoPaths
[
0
]);
if
(
!
aPoInput
.
isOpen
()
)
...
...
@@ -163,7 +161,7 @@ static void checkFunctionNames(const OString& aLanguage)
aPoInput
.
readEntry
(
aPoEntry
);
if
(
aPoInput
.
eof
()
)
break
;
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
get
GroupId
()
==
"RID_STRLIST_FUNCTION_NAMES"
)
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
get
MsgCtxt
()
==
"RID_STRLIST_FUNCTION_NAMES"
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
...
...
@@ -183,7 +181,7 @@ static void checkFunctionNames(const OString& aLanguage)
aPoPaths
[
1
]
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/scaddins/
source/analysi
s.po"
;
"/scaddins/
message
s.po"
;
aPoInput
.
open
(
aPoPaths
[
1
]);
if
(
!
aPoInput
.
isOpen
()
)
{
...
...
@@ -197,7 +195,7 @@ static void checkFunctionNames(const OString& aLanguage)
aPoInput
.
readEntry
(
aPoEntry
);
if
(
aPoInput
.
eof
()
)
break
;
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
get
GroupId
()
==
"RID_ANALYSIS_FUNCTION_NAMES"
)
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
get
MsgCtxt
().
startsWith
(
"ANALYSIS_FUNCNAME"
)
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
...
...
@@ -214,77 +212,6 @@ static void checkFunctionNames(const OString& aLanguage)
}
aPoInput
.
close
();
aPoPaths
[
2
]
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/scaddins/source/datefunc.po"
;
aPoInput
.
open
(
aPoPaths
[
2
]);
if
(
!
aPoInput
.
isOpen
()
)
{
std
::
cerr
<<
"Warning: Cannot open "
<<
aPoPaths
[
2
]
<<
std
::
endl
;
return
;
}
for
(;;)
{
PoEntry
aPoEntry
;
aPoInput
.
readEntry
(
aPoEntry
);
if
(
aPoInput
.
eof
()
)
break
;
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getGroupId
()
==
"RID_DATE_FUNCTION_NAMES"
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
continue
;
if
(
aLocalizedCoreFunctionNames
.
find
(
aMsgStr
)
!=
aLocalizedCoreFunctionNames
.
end
()
)
aMsgStr
+=
"_ADD"
;
if
(
aLocalizedFunctionNames
.
find
(
aMsgStr
)
==
aLocalizedFunctionNames
.
end
()
)
{
aLocalizedFunctionNames
[
aMsgStr
]
=
1
;
}
else
{
aLocalizedFunctionNames
[
aMsgStr
]
++
;
repeatedEntries
.
push_back
(
aPoEntry
);
}
}
}
aPoInput
.
close
();
aPoPaths
[
3
]
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/scaddins/source/pricing.po"
;
aPoInput
.
open
(
aPoPaths
[
3
]);
if
(
!
aPoInput
.
isOpen
()
)
{
std
::
cerr
<<
"Warning: Cannot open "
<<
aPoPaths
[
3
]
<<
std
::
endl
;
return
;
}
for
(;;)
{
PoEntry
aPoEntry
;
aPoInput
.
readEntry
(
aPoEntry
);
if
(
aPoInput
.
eof
()
)
{
break
;
}
if
(
!
aPoEntry
.
isFuzzy
()
&&
aPoEntry
.
getGroupId
()
==
"RID_PRICING_FUNCTION_NAMES"
)
{
OString
aMsgStr
=
aPoEntry
.
getMsgStr
();
if
(
aMsgStr
.
isEmpty
()
)
continue
;
if
(
aLocalizedCoreFunctionNames
.
find
(
aMsgStr
)
!=
aLocalizedCoreFunctionNames
.
end
()
)
aMsgStr
+=
"_ADD"
;
if
(
aLocalizedFunctionNames
.
find
(
aMsgStr
)
==
aLocalizedFunctionNames
.
end
()
)
{
aLocalizedFunctionNames
[
aMsgStr
]
=
1
;
}
else
{
aLocalizedFunctionNames
[
aMsgStr
]
++
;
repeatedEntries
.
push_back
(
aPoEntry
);
}
}
}
aPoInput
.
close
();
for
(
auto
const
&
localizedFunctionName
:
aLocalizedFunctionNames
)
{
if
(
localizedFunctionName
.
second
>
1
)
...
...
@@ -297,7 +224,7 @@ static void checkFunctionNames(const OString& aLanguage)
}
}
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
aPoInput
.
open
(
aPoPaths
[
i
]);
if
(
!
aPoInput
.
isOpen
()
)
...
...
@@ -309,25 +236,13 @@ static void checkFunctionNames(const OString& aLanguage)
{
case
0
:
{
PoHeader
hd
(
OString
(
"formula/
source/core/resource
"
));
PoHeader
hd
(
OString
(
"formula/
inc
"
));
aPoOutput
.
writeHeader
(
hd
);
break
;
}
case
1
:
{
PoHeader
hd
(
OString
(
"scaddins/source/analysis"
));
aPoOutput
.
writeHeader
(
hd
);
break
;
}
case
2
:
{
PoHeader
hd
(
OString
(
"scaddins/source/datefunc"
));
aPoOutput
.
writeHeader
(
hd
);
break
;
}
case
3
:
{
PoHeader
hd
(
OString
(
"scaddins/source/pricing"
));
PoHeader
hd
(
OString
(
"scaddins/inc"
));
aPoOutput
.
writeHeader
(
hd
);
break
;
}
...
...
@@ -343,7 +258,7 @@ static void checkFunctionNames(const OString& aLanguage)
break
;
for
(
auto
const
&
repeatedEntry
:
repeatedEntries
)
{
if
(
repeatedEntry
.
getMsgId
()
==
aPoEntry
.
getMsgId
()
&&
repeatedEntry
.
get
GroupId
()
==
aPoEntry
.
getGroupId
())
if
(
repeatedEntry
.
getMsgId
()
==
aPoEntry
.
getMsgId
()
&&
repeatedEntry
.
get
MsgCtxt
()
==
aPoEntry
.
getMsgCtxt
())
{
bError
=
true
;
break
;
...
...
@@ -429,7 +344,7 @@ static void checkMathSymbolNames(const OString& aLanguage)
OString
aPoPath
=
OString
(
getenv
(
"SRC_ROOT"
))
+
"/translations/source/"
+
aLanguage
+
"/starmath/
source
.po"
;
"/starmath/
messages
.po"
;
PoIfstream
aPoInput
;
aPoInput
.
open
(
aPoPath
);
if
(
!
aPoInput
.
isOpen
()
)
...
...
@@ -439,7 +354,7 @@ static void checkMathSymbolNames(const OString& aLanguage)
}
PoOfstream
aPoOutput
;
aPoOutput
.
open
(
aPoPath
+
".new"
);
PoHeader
aTmp
(
"starmath/
source
"
);
PoHeader
aTmp
(
"starmath/
inc
"
);
aPoOutput
.
writeHeader
(
aTmp
);
bool
bError
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment