Hi,

vangyzen> Above, I mentioned two issues.  The other one is, the date format for
vangyzen> en_US pads the month with a zero, but the day with a space.  So, June 
7 is:

vangyzen>         06/ 7/16

vangyzen> That looks weird.  It should pad both with zeros.  I'd be happy to fix
vangyzen> it, but I don't see how:  There isn't an "xformat" callback in the
vangyzen> cldr2def.pl script, and it's not clear how to add one.  If you can
vangyzen> explain, I'll do it.  If you can fix it, I'll be grateful.  ;)

Does the attached patch fix your issue?
Though there are many locales it should be fixed, I've included only
en_US one, in this time.

Sincerely,

Index: share/timedef/en_US.UTF-8.src
===================================================================
--- share/timedef/en_US.UTF-8.src	(revision 302002)
+++ share/timedef/en_US.UTF-8.src	(working copy)
@@ -53,7 +53,7 @@
 %I:%M:%S %p
 #
 # x_fmt
-%m/%e/%y
+%m/%d/%y
 #
 # c_fmt
 %A, %B %e, %Y at %I:%M:%S %p
@@ -80,7 +80,7 @@
 December
 #
 # md_order
-m
+md
 #
 # ampm_fmt
 %I:%M:%S %p
Index: tools/tools/locale/tools/cldr2def.pl
===================================================================
--- tools/tools/locale/tools/cldr2def.pl	(revision 302002)
+++ tools/tools/locale/tools/cldr2def.pl	(working copy)
@@ -68,6 +68,7 @@
 	mdorder => \&callback_mdorder,
 	altmon => \&callback_altmon,
 	cformat => \&callback_cformat,
+	dformat => \&callback_dformat,
 	dtformat => \&callback_dtformat,
 	cbabmon => \&callback_abmon,
 	cbampm => \&callback_ampm,
@@ -183,10 +184,9 @@
 	    "abday"		=> "as",
 	    "day"		=> "as",
 	    "t_fmt"		=> "s",
-	    "d_fmt"		=> "s",
+	    "d_fmt"		=> "<dformat<d_fmt<s",
 	    "c_fmt"		=> "<cformat<d_t_fmt<s",
 	    "am_pm"		=> "<cbampm<am_pm<as",
-	    "d_fmt"		=> "s",
 	    "d_t_fmt"		=> "<dtformat<d_t_fmt<s",
 	    "altmon"		=> "<altmon<mon<as",
 	    "md_order"		=> "<mdorder<d_fmt<s",
@@ -225,6 +225,14 @@
 	return $s;
 };
 
+sub callback_dformat {
+	my $s = shift;
+
+	$s =~ s/(%m(<SOLIDUS>|[-.]))%e/$1%d/;
+	$s =~ s/%e((<SOLIDUS>|[-.])%m)/%d$1/;
+	return $s;
+};
+
 sub callback_dtformat {
 	my $s = shift;
 	my $nl = $callback{data}{l} . "_" . $callback{data}{c};
@@ -241,7 +249,8 @@
 sub callback_mdorder {
 	my $s = shift;
 	return undef if (!defined $s);
-	$s =~ s/[^dm]//g;
+	$s =~ s/[^dem]//g;
+	$s =~ s/e/d/g;
 	return $s;
 };
 
--
Hajimu UMEMOTO
u...@mahoroba.org  u...@freebsd.org
http://www.mahoroba.org/~ume/
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to