diff options
author | Bustamam Harun <bustamam@openoffice.org> | 2002-02-19 23:35:43 +0000 |
---|---|---|
committer | Bustamam Harun <bustamam@openoffice.org> | 2002-02-19 23:35:43 +0000 |
commit | ad1151e1c8eeb6f5a45f1fda4813cc89f69ab8a6 (patch) | |
tree | 04be768acc1921433cf0a1ec7284f73dd5a37aa2 /i18npool/source/localedata/data/list-locales.awk | |
parent | 431951a9ce5af0a7fb8ed5ab58d4b3f191397761 (diff) |
Moving localedata_CJK localedata_ascii to localedata/data
Diffstat (limited to 'i18npool/source/localedata/data/list-locales.awk')
-rw-r--r-- | i18npool/source/localedata/data/list-locales.awk | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/i18npool/source/localedata/data/list-locales.awk b/i18npool/source/localedata/data/list-locales.awk new file mode 100644 index 000000000000..e2c53ced0c5e --- /dev/null +++ b/i18npool/source/localedata/data/list-locales.awk @@ -0,0 +1,59 @@ +#!/usr/bin/gawk -f +#// Usage: gawk -f list-locales.awk *.xml +#// Simply create a verbose list of known locales as stated in XML files. +#// Author: Eike Rathke <erack@sun.com> + +BEGIN { + lcinfo = 0 + inlang = 0 + incoun = 0 + file = "" + language = "" + country = "" +} + +FILENAME != file { + printEntry() + file = FILENAME +} + +{ + if ( !lcinfo ) + { + if ( /<LC_INFO>/ ) + lcinfo = 1 + next + } + if ( /<\/LC_INFO>/ ) + { + lcinfo = 0 + next + } + if ( /<Language>/ ) + inlang = 1 + if ( inlang && /<DefaultName>/ ) + { + split( $0, x, /<|>/ ) + language = x[3] + } + if ( /<\/Language>/ ) + inlang = 0 + if ( /<Country>/ ) + incoun = 1 + if ( incoun && /<DefaultName>/ ) + { + split( $0, x, /<|>/ ) + country = x[3] + } + if ( /<\/Country>/ ) + incoun = 0 +} + +END { + printEntry() +} + +function printEntry() { + if ( file ) + printf( "%s: %s %s\n", file, language, country ) +} |