diff options
| author | Yuri Pankov <yuripv@FreeBSD.org> | 2018-12-06 10:41:22 +0000 |
|---|---|---|
| committer | Yuri Pankov <yuripv@FreeBSD.org> | 2018-12-06 10:41:22 +0000 |
| commit | a52c0ea420dade81a9426c51a14942d78c02c968 (patch) | |
| tree | baa71762c08557468168fe4bdc77c0aaf09373bb /tools | |
| parent | feca98843cc3be75fe25e41a48284a85e9193fcc (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/tools/locale/Makefile | 4 | ||||
| -rwxr-xr-x | tools/tools/locale/tools/cldr2def.pl | 23 |
2 files changed, 15 insertions, 12 deletions
diff --git a/tools/tools/locale/Makefile b/tools/tools/locale/Makefile index 9e8483dc445c..79b447492336 100644 --- a/tools/tools/locale/Makefile +++ b/tools/tools/locale/Makefile @@ -54,7 +54,7 @@ LC:= --lc=${LC} .endif all: - cp ${ETCDIR}/common.UTF-8.src ${CLDRDIR}/posix/xx_Comm_US.UTF-8.src + cp ${ETCDIR}/common.UTF-8.src ${CLDRDIR}/posix/xx_Comm_C.UTF-8.src .for t in ${TYPES} . if ${KNOWN:M${t}} test -d ${t} || mkdir ${t} @@ -105,7 +105,7 @@ static-colldef: .endfor transfer-rollup: - cp ${ETCDIR}/common.UTF-8.src ${CLDRDIR}/posix/xx_Comm_US.UTF-8.src + cp ${ETCDIR}/common.UTF-8.src ${CLDRDIR}/posix/xx_Comm_C.UTF-8.src rollup: perl -I tools tools/utf8-rollup.pl \ diff --git a/tools/tools/locale/tools/cldr2def.pl b/tools/tools/locale/tools/cldr2def.pl index a34c5477670b..b52899fa4f3c 100755 --- a/tools/tools/locale/tools/cldr2def.pl +++ b/tools/tools/locale/tools/cldr2def.pl @@ -416,6 +416,9 @@ sub get_languages { } sub transform_ctypes { + # Add the C.UTF-8 + $languages{"C"}{"x"}{data}{"x"}{$DEFENCODING} = undef; + foreach my $l (sort keys(%languages)) { foreach my $f (sort keys(%{$languages{$l}})) { foreach my $c (sort keys(%{$languages{$l}{$f}{data}})) { @@ -424,13 +427,12 @@ sub transform_ctypes { next if (defined $languages{$l}{$f}{definitions} && $languages{$l}{$f}{definitions} !~ /$TYPE/); $languages{$l}{$f}{data}{$c}{$DEFENCODING} = 0; # unread - my $file; - $file = $l . "_"; - $file .= $f . "_" if ($f ne "x"); - $file .= $c; + my $file = $l; + $file .= "_" . $f if ($f ne "x"); + $file .= "_" . $c if ($c ne "x"); my $actfile = $file; - my $filename = "$CLDRDIR/posix/xx_Comm_US.UTF-8.src"; + my $filename = "$CLDRDIR/posix/xx_Comm_C.UTF-8.src"; if (! -f $filename) { print STDERR "Cannot open $filename\n"; next; @@ -939,8 +941,8 @@ EOF } keys(%{$hashtable{$hash}}); } elsif ($TYPE eq "ctypedef") { @files = sort { - if ($a eq 'en_x_US.UTF-8') { return -1; } - elsif ($b eq 'en_x_US.UTF-8') { return 1; } + if ($a eq 'C_x_x.UTF-8') { return -1; } + elsif ($b eq 'C_x_x.UTF-8') { return 1; } if ($a =~ /^en_x_US/) { return -1; } elsif ($b =~ /^en_x_US/) { return 1; } @@ -962,6 +964,7 @@ EOF } if ($#files > 0) { my $link = shift(@files); + $link =~ s/_x_x//; # special case for C $link =~ s/_x_/_/; # strip family if none there foreach my $file (@files) { my @a = split(/_/, $file); @@ -987,9 +990,9 @@ EOF next; } foreach my $e (sort keys(%{$languages{$l}{$f}{data}{$c}})) { - my $file = $l . "_"; - $file .= $f . "_" if ($f ne "x"); - $file .= $c; + my $file = $l; + $file .= "_" . $f if ($f ne "x"); + $file .= "_" . $c if ($c ne "x"); next if (!defined $languages{$l}{$f}{data}{$c}{$e}); print FOUT "LOCALES+=\t$file.$e\n"; } |
