diff options
author | Eike Rathke <erack@redhat.com> | 2012-07-21 01:07:54 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-07-21 01:08:43 +0200 |
commit | 61c1af3336e91144fadeffe1a479e2a0f10cdfd1 (patch) | |
tree | f3b95d4f041fc4b09432216cadecf3cb2d877c5b /i18npool | |
parent | d039b0070d62a54740b3f88d52debe3d5f4d664c (diff) |
make this extensible and do not omit inherited without patterns
Change-Id: I97a554169637740aab4282b303a32f476f294e2f
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/data/list-dateacceptancepattern.awk | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/i18npool/source/localedata/data/list-dateacceptancepattern.awk b/i18npool/source/localedata/data/list-dateacceptancepattern.awk index 87ddfdca7303..b2729052273e 100644 --- a/i18npool/source/localedata/data/list-dateacceptancepattern.awk +++ b/i18npool/source/localedata/data/list-dateacceptancepattern.awk @@ -23,7 +23,9 @@ BEGIN { --ARGC } file = "" - nopatterns = 0 + offlocale = 0 + offpatterns = 1 + offinherit = 2 inheritedcount = 0 if (html) print "<p>" @@ -58,6 +60,11 @@ file != FILENAME { END { if (file) endFile() + + PROCINFO["sorted_in"] = "@ind_str_asc" + + fillAllInherited() + if (html) { print "</ul>" @@ -70,19 +77,19 @@ END { if (html) { print "<br>" - for (i=0; i<inheritedcount; ++i) + for (i in LocaleList) { - if (LocaleHasPatterns[InheritedList[i][1]]) - print InheritedList[i][0] " = " InheritedList[i][1] " " + if (LocaleList[i][offinherit] && LocaleList[i][offpatterns]) + print LocaleList[i][offlocale] " = " LocaleList[i][offinherit] " " } print "\n<p>" } else { - for (i=0; i<inheritedcount; ++i) + for (i in LocaleList) { - if (LocaleHasPatterns[InheritedList[i][1]]) - print InheritedList[i][0] " = " InheritedList[i][1] + if (LocaleList[i][offinherit] && LocaleList[i][offpatterns]) + print LocaleList[i][offlocale] " = " LocaleList[i][offinherit] } print "\n" } @@ -95,16 +102,18 @@ END { print "<p>" if (html) { - for (i=0; i<nopatterns; ++i) + for (i in LocaleList) { - print NoPatternList[i] " " + if (!LocaleList[i][offpatterns]) + print LocaleList[i][offlocale] " " } } else { - for (i=0; i<nopatterns; ++i) + for (i in LocaleList) { - print NoPatternList[i] + if (!LocaleList[i][offpatterns]) + print LocaleList[i][offlocale] } } } @@ -112,7 +121,8 @@ END { function endFile() { locale = getLocale( file) - LocaleHasPatterns[locale] = patterns + LocaleList[locale][offlocale] = locale + LocaleList[locale][offpatterns] = patterns if (patterns) { if (html) @@ -135,21 +145,31 @@ function endFile() { } } else if (inherited) - { - InheritedList[inheritedcount][0] = locale - InheritedList[inheritedcount][1] = inherited - ++inheritedcount - } - else - NoPatternList[nopatterns++] = locale + LocaleList[locale][offinherit] = inherited } -function getLocale( file, tmp ) { +function getLocale( file, tmp ) { tmp = file gsub( /.*\//, "", tmp ) gsub( /\.xml/, "", tmp ) return tmp } + +function fillInherited( locale ) { + if (!LocaleList[locale][offpatterns] && LocaleList[locale][offinherit]) + LocaleList[locale][offpatterns] = fillInherited( LocaleList[locale][offinherit]) + return LocaleList[locale][offpatterns] +} + + +function fillAllInherited( i ) { + for (i in LocaleList) + { + if (!LocaleList[i][offpatterns] && LocaleList[i][offinherit]) + LocaleList[i][offpatterns] = fillInherited( LocaleList[i][offinherit]) + } +} + # vim:set shiftwidth=4 softtabstop=4 expandtab: |