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
17e6c9b8
Kaydet (Commit)
17e6c9b8
authored
Nis 30, 2012
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
script to list locales with and without DateAcceptancePattern
üst
0992e511
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
0 deletions
+121
-0
list-dateacceptancepattern.awk
...ool/source/localedata/data/list-dateacceptancepattern.awk
+121
-0
No files found.
i18npool/source/localedata/data/list-dateacceptancepattern.awk
0 → 100644
Dosyayı görüntüle @
17e6c9b8
#!/usr/bin/gawk -f
# -*- Mode: awk; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
#
# Copyright 2012 LibreOffice contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Usage: gawk -f list-dateacceptancepattern.awk *.xml [--html]
# Outputs two lists of locales, one with DateAcceptancePattern elements
# defined, and one where none are defined.
# If --html is given as the last parameter, format output suitable for
# inclusion in HTML.
BEGIN
{
html
=
0
if
(
ARGV
[
ARGC
-
1
]
==
"--html"
)
{
html
=
1
--
ARGC
}
file
=
""
nopatterns
=
0
if
(
html
)
print
"<p>"
else
print
""
print
"Locales with explicit DateAcceptancePattern elements:"
if
(
html
)
print
"<ul>"
}
file
!=
FILENAME
{
if
(
file
)
endFile
()
file
=
FILENAME
patterns
=
0
noFormatCode
=
1
}
/<DateAcceptancePattern>/
{
split
(
$0
,
a
,
/<|>/
)
pattern
[
patterns
++
]
=
a
[
3
]
}
# No FormatCode element means inherited LC_FORMAT ref=...
# hence pattern inherited as well.
/<FormatCode>/
{
noFormatCode
=
0
}
END
{
if
(
file
)
endFile
()
if
(
html
)
{
print
"</ul>"
print
"\n<p>"
}
else
print
"\n"
print
"Locales without explicit DateAcceptancePattern elements:"
if
(
html
)
print
"<br>"
print
"(one implicit full date pattern is always generated)"
if
(
html
)
print
"<p>"
if
(
html
)
{
for
(
i
=
0
;
i
<
nopatterns
;
++
i
)
{
print
NoPatternList
[
i
]
" "
}
}
else
{
for
(
i
=
0
;
i
<
nopatterns
;
++
i
)
{
print
NoPatternList
[
i
]
}
}
}
function
endFile
()
{
if
(
patterns
)
{
if
(
html
)
{
print
" <li> "
getLocale
(
file
)
":"
print
" <ul>"
for
(
i
=
0
;
i
<
patterns
;
++
i
)
{
print
" <li> "
pattern
[
i
]
}
print
" </ul>"
}
else
{
print
getLocale
(
file
)
":"
for
(
i
=
0
;
i
<
patterns
;
++
i
)
{
print
" "
pattern
[
i
]
}
}
}
else
if
(
!
noFormatCode
)
NoPatternList
[
nopatterns
++
]
=
getLocale
(
file
)
}
function
getLocale
(
file
,
tmp
)
{
tmp
=
file
gsub
(
/.*
\/
/
,
""
,
tmp
)
gsub
(
/
\.
xml/
,
""
,
tmp
)
return
tmp
}
# vim:set shiftwidth=4 softtabstop=4 expandtab:
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