This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/5] localedata: CLDRv28: update LC_ADDRESS.lang_name translations


On 13 Feb 2016 03:28, Dmitry V. Levin wrote:
> On Tue, Feb 09, 2016 at 01:13:06AM -0500, Mike Frysinger wrote:
> > This updates a bunch of locales based on CLDR v28 data:
> >   be_BY: changing ÐÐÐÐÑÑÑÐÐÑ ÐÐÐÐ to ÐÐÐÐÑÑÑÐÐÑ
> >   bg_BG: changing ÐÑÐÐÐÑÑÐÐ ÐÐÐÐ to ÐÑÐÐÐÑÑÐÐ
> [...]
> > --- a/localedata/locales/be_BY
> > +++ b/localedata/locales/be_BY
> > @@ -182,7 +182,7 @@ country_num 112
> >  % BY
> >  country_car    "<U0042><U0059>"
> >  % ÐÐÐÐÑÑÑÐÐÑ ÐÐÐÐ
> > -lang_name    "<U0431><U0435><U043B><U0430><U0440><U0443><U0441><U043A><U0430><U044F><U0020><U043C><U043E><U0432><U0430>"
> > +lang_name    "<U0431><U0435><U043B><U0430><U0440><U0443><U0441><U043A><U0430><U044F>"
> [...]
> > --- a/localedata/locales/bg_BG
> > +++ b/localedata/locales/bg_BG
> > @@ -268,7 +268,7 @@ country_num   100
> >  country_car  "<U0042><U0047>"
> >  country_isbn  954
> >  % ÐÑÐÐÐÑÑÐÐ ÐÐÐÐ
> > -lang_name    "<U0431><U044A><U043B><U0433><U0430><U0440><U0441><U043A><U0438><U0020><U0435><U0437><U0438><U043A>"
> > +lang_name    "<U0431><U044A><U043B><U0433><U0430><U0440><U0441><U043A><U0438>"
> 
> All these comments are falling out of sync.  BTW, they don't seem to
> provide any information in addition to keywords they comment,
> so what's the use of keeping such comments?

i noted in an earlier message that i need to respin and throw away the
comments because they are out of sync.  this gets back to a previous
conversation we had about using UTF-8 encoding in all the localedata
files instead of ASCII.  these <Uxxxx> encodings are a pita.

until that happens, i use:
$ ./filter.py locales/en_US
...
LC_TELEPHONE
tel_int_fmt    "+%c (%a)/
 %l"
tel_dom_fmt    "(%a) %l"
int_select     "11"
int_prefix     "1"
END LC_TELEPHONE
...
-mike
#!/usr/bin/python

from __future__ import print_function

import argparse
import re
import sys


def unirep(match):
    return chr(int(match.group(1), 16))


def process(opts, path):
    conv = re.compile(r'<U([0-9A-Fa-f]+)>')
    with open(path) as fp:
        for line in fp:
            line = conv.sub(unirep, line)
            print(line, end='')


def get_parser():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument('files', nargs='+')
    return parser


def main(argv):
    parser = get_parser()
    opts = parser.parse_args(argv)
    for f in opts.files:
        process(opts, f)


if __name__ == '__main__':
    exit(main(sys.argv[1:]))

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]