From 38feb1ef3840a7c4aa8b70e4d1570675697a53ae Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 20 Jul 2012 23:19:31 +0200 Subject: include locales inheriting patterns Change-Id: I06f4578f6d681064a8e41e4bef45a7034b7b5a64 --- .../localedata/data/list-dateacceptancepattern.awk | 56 +++++++++++++++++----- 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'i18npool/source') diff --git a/i18npool/source/localedata/data/list-dateacceptancepattern.awk b/i18npool/source/localedata/data/list-dateacceptancepattern.awk index b1ad115e52ca..87ddfdca7303 100644 --- a/i18npool/source/localedata/data/list-dateacceptancepattern.awk +++ b/i18npool/source/localedata/data/list-dateacceptancepattern.awk @@ -8,8 +8,11 @@ # 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. +# +# Outputs three lists of locales, one with DateAcceptancePattern elements +# defined, one with inherited LC_FORMAT elements and thus date patterns, and +# one where no DateAcceptancePattern are defined. +# # If --html is given as the last parameter, format output suitable for # inclusion in HTML. @@ -21,6 +24,7 @@ BEGIN { } file = "" nopatterns = 0 + inheritedcount = 0 if (html) print "

" else @@ -36,7 +40,7 @@ file != FILENAME { endFile() file = FILENAME patterns = 0 - noFormatCode = 1 + inherited = "" } // { @@ -44,10 +48,10 @@ file != FILENAME { pattern[patterns++] = a[3] } -# No FormatCode element means inherited LC_FORMAT ref=... -# hence pattern inherited as well. -// { - noFormatCode = 0 +# pattern inherited as well +/]* ref="[^>"]+"[^>]*>/ { + split( $0, a, /.* ref="|"/ ) + inherited = a[2] } @@ -61,6 +65,28 @@ END { } else print "\n" + + print "Locales inheriting patterns:" + if (html) + { + print "
" + for (i=0; i" + } + else + { + for (i=0; i" @@ -85,11 +111,13 @@ END { function endFile() { + locale = getLocale( file) + LocaleHasPatterns[locale] = patterns if (patterns) { if (html) { - print "

  • " getLocale( file) ":" + print "
  • " locale ":" print "