svn commit: r196095 - user/edwin/locale/tools

Edwin Groothuis edwin at FreeBSD.org
Tue Aug 11 08:19:16 UTC 2009


Author: edwin
Date: Tue Aug 11 08:19:15 2009
New Revision: 196095
URL: http://svn.freebsd.org/changeset/base/196095

Log:
  Be able to specify for which defitions (msgdef, numericdef etc) the
  locale has to be build. This is to accomodate for the la_LN which
  doesn't exist in the CLDR but does do in the FreeBSD locale directory
  (Why?!?!?!?) and then only in the timedef directory.
  
  I demand an ancient Brabants locale :-)

Added:
  user/edwin/locale/tools/la_LN.UTF-8.src
Modified:
  user/edwin/locale/tools/charmaps.pm
  user/edwin/locale/tools/charmaps.xml
  user/edwin/locale/tools/cldr2def.pl

Modified: user/edwin/locale/tools/charmaps.pm
==============================================================================
--- user/edwin/locale/tools/charmaps.pm	Mon Aug 10 22:22:32 2009	(r196094)
+++ user/edwin/locale/tools/charmaps.pm	Tue Aug 11 08:19:15 2009	(r196095)
@@ -55,12 +55,14 @@ sub h_start {
 		my $nc_link = $attrs{namecountry_link};
 		my $e_link = $attrs{encoding_link};
 		my $fallback = $attrs{fallback};
+		my $definitions = $attrs{definitions};
 
 		$d{L}{$name}{$f}{fallback} = $fallback;
 		$d{L}{$name}{$f}{e_link} = $e_link;
 		$d{L}{$name}{$f}{nc_link} = $nc_link;
 		$d{L}{$name}{$f}{family} = $family;
 		$d{L}{$name}{$f}{encoding} = $encoding;
+		$d{L}{$name}{$f}{definitions} = $definitions;
 		$d{L}{$name}{$f}{countries} = $countries;
 		foreach my $c (split(" ", $countries)) {
 			if (defined $encoding) {

Modified: user/edwin/locale/tools/charmaps.xml
==============================================================================
--- user/edwin/locale/tools/charmaps.xml	Mon Aug 10 22:22:32 2009	(r196094)
+++ user/edwin/locale/tools/charmaps.xml	Tue Aug 11 08:19:15 2009	(r196095)
@@ -12,6 +12,8 @@
 			by space
 		fallback = read this file if name_countries doesn't exist - \
 			only one
+		definitions = only use in these definitions (msgdef, timedef, \
+			numericdef, monetdef)
 
 		By default, the name of the input file is name_countries.
 		If family is defined, the name of the input file will be \
@@ -107,7 +109,7 @@
 		countries="KR" />
 	<language name="la"
 		encoding="ISO8859-1 ISO8859-2 ISO8859-4 ISO8859-15 US-ASCII"
-		countries="LN" />
+		countries="LN" definitions="timedef" />
 	<language name="lt"
 		encoding="ISO8859-4 ISO8859-13"
 		countries="LT" />

Modified: user/edwin/locale/tools/cldr2def.pl
==============================================================================
--- user/edwin/locale/tools/cldr2def.pl	Mon Aug 10 22:22:32 2009	(r196094)
+++ user/edwin/locale/tools/cldr2def.pl	Tue Aug 11 08:19:15 2009	(r196095)
@@ -305,28 +305,32 @@ sub get_fields {
 	foreach my $c (sort keys(%{$languages{$l}{$f}{data}})) {
 		next if ($#filter == 2 && ($filter[0] ne $l
 		    || $filter[1] ne $f || $filter[2] ne $c));
+		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;
-		if (!open(FIN, "$CLDRDIR/posix/$file.$DEFENCODING.src")) {
-			if (!defined $languages{$l}{$f}{fallback}) {
-				print STDERR
-				    "Cannot open $file.$DEFENCODING.src\n";
-				next;
-			}
+
+		my $filename = "$CLDRDIR/posix/$file.$DEFENCODING.src";
+		$filename = "$XMLDIR/$file.$DEFENCODING.src"
+		    if (! -f $filename);
+		if (! -f $filename
+		 && defined $languages{$l}{$f}{fallback}) {
 			$file = $languages{$l}{$f}{fallback};
-			if (!open(FIN,
-			    "$CLDRDIR/posix/$file.$DEFENCODING.src")) {
-				print STDERR
-				    "Cannot open fallback " .
-				    "$file.$DEFENCODING.src\n";
-				next;
-			}
+			$filename = "$CLDRDIR/posix/$file.$DEFENCODING.src";
+		}
+		$filename = "$CLDRDIR/posix/$file.$DEFENCODING.src"
+		    if (! -f $filename);
+		if (! -f $filename) {
+			print STDERR
+			    "Cannot open $file.$DEFENCODING.src or fallback\n";
+			next;
 		}
-		print "Reading from $file.$DEFENCODING.src for ${l}_${f}_${c}\n";
+		open(FIN, "$filename");
+		print "Reading from $filename for ${l}_${f}_${c}\n";
 		$languages{$l}{$f}{data}{$c}{$DEFENCODING} = 1;	# read
 		my @lines = <FIN>;
 		chomp(@lines);
@@ -440,6 +444,8 @@ sub print_fields {
 	foreach my $c (sort keys(%{$languages{$l}{$f}{data}})) {
 		next if ($#filter == 2 && ($filter[0] ne $l
 		    || $filter[1] ne $f || $filter[2] ne $c));
+		next if (defined $languages{$l}{$f}{definitions}
+		    && $languages{$l}{$f}{definitions} !~ /$TYPE/);
 		foreach my $enc (sort keys(%{$languages{$l}{$f}{data}{$c}})) {
 			if ($languages{$l}{$f}{data}{$c}{$DEFENCODING} eq "0") {
 				print "Skipping ${l}_" .
@@ -628,6 +634,8 @@ EOF
 	foreach my $c (sort keys(%{$languages{$l}{$f}{data}})) {
 		next if ($#filter == 2 && ($filter[0] ne $l
 		    || $filter[1] ne $f || $filter[2] ne $c));
+		next if (defined $languages{$l}{$f}{definitions}
+		    && $languages{$l}{$f}{definitions} !~ /$TYPE/);
 		if (defined $languages{$l}{$f}{data}{$c}{$DEFENCODING}
 		 && $languages{$l}{$f}{data}{$c}{$DEFENCODING} eq "0") {
 			print "Skipping ${l}_" . ($f eq "x" ? "" : "${f}_") .

Added: user/edwin/locale/tools/la_LN.UTF-8.src
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/edwin/locale/tools/la_LN.UTF-8.src	Tue Aug 11 08:19:15 2009	(r196095)
@@ -0,0 +1,68 @@
+comment_char *
+escape_char /
+
+********************************************************************************
+* POSIX Locale                                                                 *
+* Locale Name : la_LN   Codeset : UTF-8
+*
+* This is Latin. The week with seven days was introduced in the
+* Roman Empire 321 AD. (Konstantin I)
+********************************************************************************
+
+*************
+LC_TIME
+*************
+
+abday   "<S><o><l>";/
+        "<L><u><n>";/
+        "<M><a><r>";/
+        "<M><e><r>";/
+        "<I><o><v>";/
+        "<V><e><n>";/
+        "<S><a><t>"
+
+day     "<d><i><e><s><SPACE><S><o><l><i><s>";/
+        "<d><i><e><s><SPACE><L><u><n><a><e>";/
+        "<d><i><e><s><SPACE><M><a><r><t><i><s>";/
+        "<d><i><e><s><SPACE><M><e><r><c><u><r><i><i>";/
+        "<d><i><e><s><SPACE><I><o><v><i><s>";/
+        "<d><i><e><s><SPACE><V><e><n><e><r><i><s>";/
+        "<d><i><e><s><SPACE><S><a><t><u><r><n><i>"
+
+abmon   "<I><a><n>";/
+        "<F><e><b>";/
+        "<M><a><r>";/
+        "<A><p><r>";/
+        "<M><a><i>";/
+	"<I><u><n>";/
+        "<I><u><l>";/
+        "<A><u><g>";/
+        "<S><e><p>";/
+        "<O><c><t>";/
+        "<N><o><v>";/
+        "<D><e><c>"
+
+mon     "<I><a><n><u><a><r><i><u><s>";/
+	"<F><e><b><r><u><a><r><i><u><s>";/
+	"<M><a><r><t><i><u><s>";/
+	"<A><p><r><i><l><i><s>";/
+	"<M><a><i><u><s>";/
+	"<I><u><n><i><u><s>";/
+	"<I><u><l><i><u><s>";/
+	"<A><u><g><u><s><t><u><s>";/
+	"<S><e><p><t><e><m><b><e><r>";/
+	"<O><c><t><o><b><e><r>";/
+	"<N><o><v><e><m><b><e><r>";/
+	"<D><e><c><e><m><b><e><r>";
+
+d_fmt    "%d.%m.%y"
+
+d_t_fmt  "%a %e %b %Y:%X %Z"
+
+t_fmt    "%H:%M:%S"
+
+am_pm    "<A><M>";"<P><M>"
+
+t_fmt_ampm  ""
+
+END LC_TIME


More information about the svn-src-user mailing list